Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ("index.htm");
- session_start();
- $username = $_POST['username'];
- $password = $_POST['password'];
- if ($username&&$password)
- {
- include 'forum/connect.php';
- $query = mysql_query("SELECT * FROM users WHERE username='$username'");
- $numrows;
- $numrows = mysql_num_rows($query);
- echo 'num rows: ' . $numrows . ' mysql_error . ' . mysql_error(); die();
- if ($numrows!=0)
- {
- while ($row = mysql_fetch_assoc ($query))
- {
- $dbusername = $row['username'];
- $dbpassword = $row['password'];
- }
- // Check to see if they match!
- if ($username==$dbusername&&md5 ($password==$dbpassword))
- {
- echo 'Successfully Logged in! <a href="member.php">Click here to enter the member page! </a>';
- $_SESSION['username']=$username;
- $_SESSION['id'] = $row['id']; $_SESSION['username'] = $row['username']; $_SESSION['password'] = $row['password']; $_SESSION['email'] = $row['email'];
- }
- else
- echo "Incorrect Password!";
- }
- else
- die("That user does not exist!");
- }
- else
- die("Please enter a username and a password");
- ?>
Add Comment
Please, Sign In to add comment