Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "config.php";
- $user = stripslashes(mysql_real_escape_string($_POST['user']));
- $pass = stripslashes(mysql_real_escape_string($_POST['pass']));
- $query = mysql_query("SELECT * FROM users WHERE Username='$user' AND Password='$pass'");
- if(!empty($_POST))
- {
- if(mysql_num_rows($query) > 0)
- {
- while($row = mysql_fetch_array($query))
- {
- print $row['Username'];
- print $row['Password'];
- print "Successfully Logged In.";
- $error = 0;
- } else if(mysql_num_rows($query) == 0) {
- print "User doesn't exist.";
- $error = 1;
- } else {
- print "Invalid Login Attempt; Please try again";
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement