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("Could Not connect");
- $db = mysql_select_db ("accounts") or die ("Could not find Database");
- $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! <a href='member.php'>Click</a> here to enter the member page.";
- $_SESSION['username']=$username;
- }
- else
- echo "Incorrect Password!";
- }
- else
- die("That user doesn't exist!");
- }
- else
- die("Please Enter a username and a password!");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement