Jump to content

[SOLVED] Login Error


BillyBoB

Recommended Posts

I have a login form that works in Firefox but it doesnt work in IE.

If somebody could help me that would be great!

 

<?php
ob_start();
include("config.php");
if(!$logged) {
if(!$_POST['login']) {
?>
<table cellspacing="0" cellpadding="0" border="0" width="124">
<tr>
  <td align="left">
   <form method="POST">
    <table cellspacing="0" cellpadding="0" border="0" width="124">
     <tr>
      <td>
        Username:
      </td>
     </tr>
     <tr>
      <td style="background: url('images/textbox.gif') no-repeat;" height="16">
       <input type="text" height="16" name="username" class="login">
      </td>
     </tr>
     <tr>
      <td>
        Password:
      </td>
     </tr>
     <tr>
      <td style="background: url('images/textbox.gif') no-repeat;" height="16">
       <input type="password" height="16" name="password" class="login"><br/><br/>
      </td>
     </tr>
     <tr>
      <td>
       <div align="center">
        <input type="image" src="images/loginbutton.gif" name="login" value="Login">
       </div>
      </td>
     </tr>
    </table>
   </form>
  </td>
</tr>
</table>
<br/>
<?php
}else{
$username = $_POST['username'];
$password = md5($_POST['password']);
$info = mysql_query("SELECT * FROM members WHERE username = '$username'") or die(mysql_error());
$data = mysql_fetch_array($info);

if($data[password]!=$password) {
echo("Wrong Password! Try again. <meta http-equiv=\"Refresh\" content=\"2;\"/>");
}else{
$query = mysql_query("SELECT * FROM members WHERE username = '$username'") or die(mysql_error());
$user = mysql_fetch_array($query);

setcookie("id", $user[id],time()+(60*60*24*1), "/", "");
setcookie("pass", $user[password],time()+(60*60*24*1), "/", "");
$newtime = time();
$time = gmdate("YmdHis", $newtime);
$ip = $_SERVER['REMOTE_ADDR'];
$lquery = mysql_query("UPDATE members SET ip = '$ip' , lastlog = '$time' WHERE username = '$username' ") or die(mysql_error());
echo ("<meta http-equiv=\"Refresh\" content=\"3; \"/>Login Successful");
}
}
}else{
echo("
CONSOLE
");
}
?>

 

Thanks in advance

 

EDIT: This site is still in beta so, I can only allow you to the login page.

 

http://animeblogsite.com/beta/

 

htaccess username and password:

Username: BetaTester

Password: happyhelper234

 

Login Page Username and Password:

Username: Beta

Password: happyhelper234

Link to comment
https://forums.phpfreaks.com/topic/53208-solved-login-error/
Share on other sites

it didnt work because of the html it had a image as a button so that it could look better i have set it up to have an image if its

firefox and if its IE to have a Submit button.

I thought you had an error with the php in IE, hence the PHP forum. For next time, letting people know what the error is might help you get the problem solved quicker.

Link to comment
https://forums.phpfreaks.com/topic/53208-solved-login-error/#findComment-262903
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.