I have this form validation script:
//Sanitize the POST values
$fname = clean($_POST['fname']);
$lname = clean($_POST['lname']);
$login = clean($_POST['login']);
$password = clean($_POST['password']);
$cpassword = clean($_POST['cpassword']);
//Input Validations
if($fname == '') {
$errmsg_arr[] = 'Voornaam ontbreekt';
$errflag = true;
}
if($lname == '') {
$errmsg_arr[] = 'Achternaam ontbreekt';
$errflag = true;
}
if($login == '') {
$errmsg_arr[] = 'Gebruikersnaam ontbreekt';
$errflag = true;
}
if($password == '') {
$errmsg_arr[] = 'Wachtwoord ontbreekt';
$errflag = true;
}
if($cpassword == '') {
$errmsg_arr[] = 'Bevestig wachtwoord ontbreekt';
$errflag = true;
}
if( strcmp($password, $cpassword) != 0 ) {
$errmsg_arr[] = 'De door u opgegeven wachtwoorden zijn niet hetzelfde';
$errflag = true;
}
and lower down its:
//If there are input validations, redirect back to the registration form
if($errflag) {
$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
session_write_close();
header("location: aanmelden.php");
exit();
}
And it does redirect me back to the register page, namely aanmelden.php but it does not show the text which says what is missing while it should. What is wrong with the script?