Boogyman showed you the strcmp before didnt he?
Code:
if(strcmp($mailadd1,$mailadd2)!=0) {
//dont match
$error = 1;
$errordetails = 1;
header('Location: http://www.mewan.net/mark/css/submitpage.php?&error=1&errordetails=1');
} else {
//matched emails
if(strcmp($pass1,$pass2)!=0) {
//didnt match passwords
$error = 1;
$errordetails = 2;
header('Location: http://www.mewan.net/mark/css/submitpage.php?&error=1&errordetails=2');
} else {
//dont know the code to do the email processing bit sorry.
}
and in your submit page you would have
Code:
if(isset($error)) {
if($errordetails == '1') {
$errormsg = 'You did not enter the same email address';
} else {
$errormsg = 'You did not enter the same password';
}
echo '<div>'.$errormsg.'</div>';
}
Note: You cannot start outputting information before you use the header function. It wont redirect to the page. I.E. make sure that this part of the code is right at the top of your page.
Iv just tested this so it should work, iv done it before in JSP, but then i did it with an errors page which would read the session that i set before i redirected to the page, but this way works. If you want an errors page, you can have that, its just the same code really.
Bookmarks