I use Firefox and it has never given me a problem when logging in but with Internet Explorer and Chrome, there seems to be a problem.. It as if it refreshes the page without doing the method of posting the form. I would really like some help as to where I may be going wrong I have uploaded the code I am using below:

<? if(!$_POST[login]){ ?>
<form method="POST" action="" name="login">
Username:&nbsp;
    <input type="text" size="22" maxlength="25" name="username" style="outline:none; background: url(input_area.png); border: 0; width: 180; height: 25; padding-left: 2px;">  
    <br /><br>
    Password:&nbsp;&nbsp;
    <input type="password" size="22" maxlength="25" name="password" autocomplete="off" style="outline:none; background: url(input_area.png); border: 0; width: 180; height: 25; padding-left: 2px;">
      <br /><br>
		<div style="width: 250px; height: 20px;"><div style="float: left; padding-top: 5px;"><center>&nbsp;</div><div style="float:right;"><img src="login_icon.png">&nbsp;&nbsp;<input type="image" src="login-image.png" name="login" value="login" /></div></div>
</form>
<?
}elseif(isset($_POST[login])){ 
$username = mysql_real_escape_string($_POST['username']);
$passwordz = mysql_real_escape_string($_POST['password']);
$password = sha1($passwordz);
$date =  date("j F  G : i");  
// the above lines set variables with the submitted information.   
$info = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'") or die(mysql_error()); 
$data = mysql_fetch_array($info); 

$sql= mysql_query("SELECT * FROM `users` WHERE `username`='$username' and `password`='$password'");
$result=mysql_fetch_array($sql);

// Mysql_num_row is counting table row
$count=mysql_num_rows($sql);
// If result matched $myusername and $mypassword, table row must be 1 row

if($count==1){

$query = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'") or die(mysql_error()); 
$user = mysql_fetch_array($query); 
}else{
echo"We are sorry the information you have submitted does not match our database!";
}
if($user[beta] ==0){
echo"We are sorry, your account has not been given BETA privilages <meta http-equiv=\"refresh\" content=\"3;url=website/\"/>";
}else{

// gets the user's information 
      $_SESSION['uniid'] = $user[id];
      $_SESSION['pass'] = $user[password];

$header =  $_SERVER["HTTP_REFERER"];
?>
<table width="100%">
<tr>
<td width="4%">
<img src="images/1.png" align="left">
</td><td style="padding-top: 10px; font-size: 10px;  
color: #000000;"><h4><font style='color: #EE4000;'>Login Successful! - Please wait while you are redirected!</font></h4></td></tr>
</tr>
</table>
<?
}
}
?>

Any help would be much appreciated!
Thank you in advance

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.