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
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
Share on other sites

I didnt know what was wrong all i know is that i had php in there.... so I put in on the php help forum.... so why dont you back off....

whoa relax there buddy. All im saying is that letting people know what the error actually is, is an important step in the debugging process.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.