Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = $_POST['username'];
- $password = $_POST['username'];
- if ($username&&$password)
- {
- // Connect To DB
- $connect = mysql_connect("localhost","root","wizpa") or die("Couldn't Connect!");
- mysql_select_db("phplogin") or die ("Couldn't Find DB");
- $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&&$password==$dbpassword)
- {
- echo "You're In!";
- }
- else
- echo "Wrong Information!";
- }
- else
- die ("That user Doesn't Exist!");
- }
- // If not entered User and/or Pass
- else
- die("Please Enter User and Password!");
- ?>
Add Comment
Please, Sign In to add comment