Changeset 661 for trunk/register.php


Ignore:
Timestamp:
Dec 28, 2004, 6:56:33 PM (19 years ago)
Author:
plg
Message:
  • register process partly rewritten
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/register.php

    r631 r661  
    3131//----------------------------------------------------------- user registration
    3232$errors = array();
    33 if ( isset( $_POST['submit'] ) )
     33if (isset($_POST['submit']))
    3434{
    35   $errors = register_user( $_POST['login'], $_POST['password'],
    36                           $_POST['password_conf'], $_POST['mail_address'] );
    37   if ( sizeof( $errors ) == 0 )
     35  $errors = register_user($_POST['login'], $_POST['password'],
     36                          $_POST['password_conf'], $_POST['mail_address']);
     37  if (count($errors) == 0)
    3838  {
     39    $query = '
     40SELECT id
     41  FROM '.USERS_TABLE.'
     42  WHERE username = \''.$_POST['login'].'\'
     43;';
     44    list($user_id) = mysql_fetch_array(pwg_query($query));
     45    $session_id = session_create($user_id, $conf['session_length']);
    3946    $url = 'category.php?id='.$session_id;
    40     redirect( $url );
     47    redirect($url);
    4148  }
    4249}
Note: See TracChangeset for help on using the changeset viewer.