Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("php-cont.php");
- session_start();
- $username = $_POST['username'];
- $password = $_POST['password'];
- if($username && $password)
- {
- $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'];
- $dbemail = $row['email'];
- $dbpassword = $row['password'];
- $activation = $row['activation'];
- if($activation == '0')
- {
- die("Your account has not been activated. Please check your email to Activate!");
- exit();
- }
- }
- // check to see if they match!
- if($username == $dbusername && md5($password) == $dbpassword)
- {
- echo "You're in! <a href='member.php'>Click</a> here to enter the member page.";
- $_SESSION['username'] = $dbusername;
- $_SESSION['email'] = $dbemail;
- }
- else
- {
- echo("Entered wrong password!");
- }
- }
- else
- die("That user doesn't exit");
- }
- else
- die("Please enter a username and password.");
- ?>
- <html>
- <head>
- <body>
- <center>
- <h1>Success!</h1>
- </center>
- </body>
- </head>
- </html>
Add Comment
Please, Sign In to add comment