Hey everyone. I just recently set up(or tried to) a userdatabase where people can log in and see a user edit page. For some reason when you try to register, instead of redirecting to the successfull register page, it just goes to a page, "process.php" which process the login when clicked. Below is my register function... can anyone see a problem?? Thanks.
function procRegister()
{
global $session, $form;
//Registration attempt
$retval = $session->register( $_POST['username'], $_POST['password'], $_POST['email'] );
//Registration success
if( $retval == 0 )
{
$_SESSION['reguname'] = $_POST['username'];
$_SESSION['regsuccess'] = true;
header( "Location: ".$session->referrer );
}
//Error found with form
else if( $retval == 1 )
{
$_SESSION['value_array'] = $_POST;
$_SESSION['error_array'] = $form->getErrorArray();
header( "Location: ".$session->referrer );
}
//Registration attempt failed
else if( $retval == 2 )
{
$_SESSION['reguname'] = $_POST['username'];
$_SESSION['regsuccess'] = false;
header( "Location: ".$session->referrer );
}
}