Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $username = $_POST['username'];
- $password = $_POST['password'];
- if ($username&&$password )
- {
- $connect = mysql_connect ("localhost","root","") or die ("Couldn't connect to server");
- mysql_select_db("assessment2") or die ("Couldn't connect to server");
- $query = mysql_query ("SELECT * FROM customers WHERE username = '$username'");
- $numrows = mysql_num_rows ($query);
- if ($numrows!=0)
- {
- while ($row = mysql_fetch_assoc($query))
- {
- $dbusrename = $row['username'];
- $dbpassword = $row['password'];
- }
- //check for match
- if ($username==$dbusername&&$password==$dbpassword)
- {
- }
- else
- echo "incorrect password";
- }
- else
- die ("That username doesn't exist");
- }
- else
- die("Please enter a Username and Password!");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement