Hi there,
I have a password script for my website (the script is 'Page Password Protect 2.13'), but I can't figure out how to modify it so it redirects to an error page instead of just popping up 'incorrect password'.
I looked high and low on the internet for a good password script, and this was the only one I could find that was easy to setup and free.
This the is the part of the script that calls the incorrect password:
---------------------------------------------------------
// user provided password
if (isset($_POST['access_password'])) {
$login = isset($_POST['access_login']) ? $_POST['access_login'] : '';
$pass = $_POST['access_password'];
if (!USE_USERNAME && !in_array($pass, $LOGIN_INFORMATION)
|| (USE_USERNAME && ( !array_key_exists($login, $LOGIN_INFORMATION) || $LOGIN_INFORMATION[$login] != $pass ) )
) {
showLoginPasswordProtect("Invalid Password");
}
else {
// set cookie if password was validated
setcookie("verify", md5($login.'%'.$pass), $timeout, '/');
// Some programs (like Form1 Bilder) check $_POST array to see if parameters passed
// So need to clear password protector variables
unset($_POST['access_login']);
unset($_POST['access_password']);
unset($_POST['Submit']);
}
}
---------------------------------------------------------
Sorry for being such a newb, but PHP is totally foreign to me.
Any help would be greatly appreciated.
I have a password script for my website (the script is 'Page Password Protect 2.13'), but I can't figure out how to modify it so it redirects to an error page instead of just popping up 'incorrect password'.
I looked high and low on the internet for a good password script, and this was the only one I could find that was easy to setup and free.
This the is the part of the script that calls the incorrect password:
---------------------------------------------------------
// user provided password
if (isset($_POST['access_password'])) {
$login = isset($_POST['access_login']) ? $_POST['access_login'] : '';
$pass = $_POST['access_password'];
if (!USE_USERNAME && !in_array($pass, $LOGIN_INFORMATION)
|| (USE_USERNAME && ( !array_key_exists($login, $LOGIN_INFORMATION) || $LOGIN_INFORMATION[$login] != $pass ) )
) {
showLoginPasswordProtect("Invalid Password");
}
else {
// set cookie if password was validated
setcookie("verify", md5($login.'%'.$pass), $timeout, '/');
// Some programs (like Form1 Bilder) check $_POST array to see if parameters passed
// So need to clear password protector variables
unset($_POST['access_login']);
unset($_POST['access_password']);
unset($_POST['Submit']);
}
}
---------------------------------------------------------
Sorry for being such a newb, but PHP is totally foreign to me.
Any help would be greatly appreciated.