Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- }
- elseif(!empty($_POST['username']) && !empty($_POST['password']))
- {
- $username = mysql_real_escape_string($_POST['username']);
- $password = md5(mysql_real_escape_string($_POST['password']));
- $checklogin = mysql_query("SELECT * FROM users WHERE Username = '".$username."' AND Password = '".$password."'");
- if(mysql_num_rows($checklogin) == 1)
- {
- $row = mysql_fetch_array($checklogin);
- $email = $row['EmailAddress'];
- $_SESSION['Username'] = $username;
- $_SESSION['EmailAddress'] = $email;
- $_SESSION['LoggedIn'] = 1;
- echo '<div class="sb">';
- echo '<div class="sbt">Success</div>';
- echo '<div class="sbn">';
- echo "<p>We are now redirecting you to the member area.</p>";
- echo "<meta http-equiv='refresh' content='=2;index.php' />";
- }
- else
- {
- echo '<div class="sb">';
- echo '<div class="sbt">Error</div>';
- echo '<div class="sbn">';
- echo "<p>Sorry, your account could not be found. Please <a href=\"index.php\">click here to try again</a>.</p>";
- }
- }
- else
- {
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement