Jump to content

login


RON_ron

Recommended Posts

this is my login php. But for some reason it dosen't log the user on the first attempt. Any idea what may be causing this?

 

$result=mysql_query("SELECT * FROM  companies WHERE username = '$user' AND password ='$pass'");
if(mysql_num_rows ($result) == 0) {
$login = "&err=Failed.";
echo($login);
} else {
$row = mysql_fetch_array($result);
$user=$row['user'];
$pass=$row['pass'];
$login = "$user=" . $user . "$pass=" . $pass . "&err=Successful.";
echo($login);
}

Link to comment
Share on other sites

I'm using this as a server side script. The "err=Successful." will trigger the action. But the issue is why doesn't it allow the user to go through the first attempt. Always the LOGIN button needs to be clicked twice. I wonder if this that's got to do something with this piece of code?

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.