Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @author Jason
- * @copyright 2010
- */
- $username = $_POST['username'];
- $password = $_POST['password'];
- if ($username&&$password)
- {
- $connect = mysql_connect("localhost","root","jason") or die("Cannot connect to localhost!");
- mysql_select_db("usersystem") or die("Cannot connect to database!");
- $query = mysql_query("SELECT * FROM users WHERE username='$username'");
- $numrows = mysql_num_rows($query);
- if ($numrows!=0)
- {
- while($row = mysql_fetch_assoc($query))
- {
- $dbusername = $row['username'];
- $dbpassword = $row['password'];
- }
- if ($username==$dbusername&&md5($password)==$dbpassword)
- {
- echo "You're in!";
- } else
- echo "Incorrect Password!";
- } else
- die("Username doesn't exist!");
- } else
- die("Enter a username and passoword!");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement