Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $connection = mysql_connect('localhost','root','') or die('Couldn\'t Connect to MySQL: ' . mysql_error();
- mysql_select_db("DATABASE_NAME", $connection) or die('Couldn\'t Select Database: ' . mysql_error($connection);
- // Because the script will die() if there were errors, no need to check if there were.
- // Later on, look into MySQL Injection Protection
- $Log_In_Username = $_POST["Log_In_Username"];
- $Log_In_Password = $_POST["Log_In_Password"];
- $sql = "SELECT Username FROM temp_users WHERE Username='" . $Log_In_Username . "' AND Password='" . $Log_In_Password . "' LIMIT 1"; // I'm assuming you are matching the username and not the email, but I could be wrong. Check for the two conditions, will save you having to compare it later.
- $result = mysql_query($sql) or die('Couldn\'t complete Query. Error: ' . mysql_error($connection));
- if (mysql_num_rows($result) > 0){
- echo 'Username/Password Combo Match Input';
- }else{
- header ("Location: Username_Not_Found.html");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement