Jump to content

Php User Login Issue

Recommended Posts

Hi...Below the code<?phpinclude "pass.php";session_start();$user = isset($_POST['user']) ? $_POST['user'] : $_SESSION['user'];$pass = isset($_POST['pass']) ? md5($_POST['pass']) : $_SESSION['pass'];mysql_query("insert into login('', '$user', '$pass')");$link = mysql_connect($hostname, $username, $password);if($link){ $db = mysql_select_db("time", $link);}$sql = "select * from login where username = '$user' and password = password('$pass')";$result2 = mysql_query($sql);if(!isset($pass) || !isset($user)){ if($result2) {?> <form method=POST action=""> <div align=center >Enter login details</div><br> <table align = center> <tr><td>Username</td><td><input type=text name=user value=""> <tr><td>Password</td><td><input type=password name=pass value=""> <tr><td><input type=submit value="Submit"></td></tr> </table> </form><?php }}else if($result2 != 'pass'){ echo "<font>Authentication Failed</font>";}?>issue for this code for password is correct or incorrect, the result will be occured Authentication failed..What is the issue for this code?pls help..regardssubha

Link to post
Share on other sites

Join the conversation

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

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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