dean012 Posted October 13, 2013 Share Posted October 13, 2013 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Yakity Yak</title> <link href='http://fonts.googleapis.com/css?family=Oswald:400,300' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Abel|Satisfy' rel='stylesheet' type='text/css'> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <p><!-- end #header --></p> <div id="header" class="container"> <div id="logo"> <h1><a href="#">Yakity Yak</a></h1> </div> <div id="menu"> <ul> <li class="current_page_item"><a href="../../Documents/Unnamed Site 2/index.html">Homepage</a></li> <li><a href="../../Documents/Unnamed Site 2/trip.html">Destinations</a></li> <li><a href="#">contact </a></li> <li><a href="#">Login</a></li> <li></li> <li></li> </ul> </div> </div> <blockquote> <blockquote> <p> <center><img src="ewrf.jpg" width="999" height="300" alt=""/></center> </p> </blockquote> </blockquote> <div id="page"> <div class="post"> <h2 class="title"><a href="#">Welcome to Yakity yak club</a></h2> <div class="entry"> <form method='post' action='homepage.php'> <table width='400' border='5' align='CENTER'> <tr> <td><h1>lOGIN</h1></td> </tr> <tr> <tr> <td>Password:</td> <td><input type='password' name='pass'/></td> </tr> <tr> <td>Email:</td> <td><input type='text' name='email'/></td> </tr> <tr> <td><input type='submit' name='login' value='login'/></td> </tr> </table> </form> <center><font color='white' size '5'>Not yet registered? </font><a href='registration.php'>Sign Up Here</a> </font> </body> </html> <?php $connect=mysql_connect("localhost","root",""); $db_selected = mysql_select_db("users_db", $connect); if(isset($_POST['login'])){ $users_pass = $_POST['pass']; $users_email = $_POST['email']; $check_users = "select *from users where users_pass='$password' AND users_email='$email'"; if(mysql_num_rows($run)>0){ echo"<script>window.open('homepage.php', '_self')</script>"; exit(); } else { echo"<script>alert('Email or password is incorrect!')</script>"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/282922-i-entered-the-wrong-pass-and-user-but-it-still-directed-me-to-the-form-action/ Share on other sites More sharing options...
Barand Posted October 13, 2013 Share Posted October 13, 2013 $users_pass = $_POST['pass']; $users_email = $_POST['email']; $check_users = "select * from users where users_pass='$password' AND users_email='$email'"; You also need to execute the query. All you have done is define a string value; Quote Link to comment https://forums.phpfreaks.com/topic/282922-i-entered-the-wrong-pass-and-user-but-it-still-directed-me-to-the-form-action/#findComment-1453719 Share on other sites More sharing options...
dean012 Posted October 16, 2013 Author Share Posted October 16, 2013 how can i do that? Quote Link to comment https://forums.phpfreaks.com/topic/282922-i-entered-the-wrong-pass-and-user-but-it-still-directed-me-to-the-form-action/#findComment-1454191 Share on other sites More sharing options...
Barand Posted October 16, 2013 Share Posted October 16, 2013 mysql_query Quote Link to comment https://forums.phpfreaks.com/topic/282922-i-entered-the-wrong-pass-and-user-but-it-still-directed-me-to-the-form-action/#findComment-1454193 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.