PHP Compatibility issue between Firefox and IE....
Posted: Tue Jun 02, 2009 10:57 am
Hi guys.
This script I am using works flawlessly in Firefox, however in IE when I enter the correct password it does nothing and simply clears the password field and resets to where I can enter it again. It never goes to the page it is protecting. In Firefox it works great. I enter the password and it take me to the page.
Here is the script:
You guys have any idea how I can get this to work in both firefox and IE?
This script I am using works flawlessly in Firefox, however in IE when I enter the correct password it does nothing and simply clears the password field and resets to where I can enter it again. It never goes to the page it is protecting. In Firefox it works great. I enter the password and it take me to the page.
Here is the script:
Code: Select all
<?php
$Password = 'testpass'; // Set your password here
/********/
if (isset($_POST['submit_pwd'])){
$pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';
if ($pass != $Password) {
showForm("Incorrect, Try Again.");
exit();
}
} else {
showForm();
exit();
}
function showForm($error="Album LOGIN"){
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Album Security</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
</head>
<body><BR /><BR /><BR /><BR /><BR /><BR /><BR /><BR />
<div id="main">
<div align="left"></div>
<div class="caption"><?php echo $error; ?></div>
<div id="icon"> </div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="pwd">
Please enter Password:
<table>
<tr><td><input class="text" name="passwd" type="password"/></td></tr>
<tr><td align="center"><br/>
<input class="text" type="submit" name="submit_pwd" value="Proceed"/>
</td></tr>
</table>
</form>
<div id="source">Art of Clarity</div>
</div>
</body>
<?php
}
?>