Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- session_start();
- include ("includes/config.php");
- if ($_POST['submit'])
- {
- $username = strtolower($_POST['username']);
- $password = md5($_POST['password']);
- if ($username && $password)
- {
- $sql = mysql_query("SELECT username, password FROM Users WHERE username = '$username'") or die mysql_error();
- while ($row = mysql_fetch_array($sql))
- {
- $dbuser = $row['username'];
- $dbpass = $row['password'];
- if(($dbuser == $username) && ($dbpass == $password))
- {
- $_SESSION['username'] = $dbuser;
- header('Location: home.php');
- }
- }
- }
- else
- {
- die("Please fill in the username and password");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement