Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['username']))
- {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $connect = mysql_connect("localhost","a26_flroot","plates123") or die("Couldn't Connect.");
- mysql_select_db("a26_flogin") or die("Couldn't connect.");
- $select = "SELECT * FROM users WHERE username = '$username' AND password='$password'";
- $query = mysql_query($select);
- $numrows = mysql_num_rows($query);
- if ($numrows==0)
- {
- /*
- while ($row = mysql_fetch_assoc($query))
- {
- $dbusername = $row['username'];
- $dbpassword = $row['password'];
- }
- // check to see if they match!
- if ($username==$dbusername&&$password==$dbpassword)
- {
- */
- echo "Welcome back, <a href='/login/member.php'>$username</a>";
- setcookie('username',$username,time()+7200, '/');
- /*
- }
- else
- echo "Incorrect password!";
- */
- }
- else
- die("That user doesnt exist!");
- }
- else
- die("Please enter an username and password.");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement