Guest User

Untitled

a guest
Oct 9th, 2013
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. <?php
  2. require'../global.php';
  3.  
  4. if (isset($_COOKIE['PeopleHubLogged'])) { header("Location: ../Home.php"); }
  5.  
  6. if (!isset($_COOKIE['PeopleHubLogged'])) {
  7.  
  8. echo "<center><font size='5'><b>Login to PeopleHub</b></font><br><form method='post'>Email: <input type='text' name='email'><br>Password: <input type='password' name='password'><br><input type='submit' name='submit' value='Log In'></form>";
  9.  
  10. if ($_POST['submit']) {
  11. if ($_POST['email']) {
  12. if ($_POST['password']) {
  13. $password = md5($_POST['password']);
  14. $email = $_POST['email'];
  15. $p = mysql_query("SELECT * FROM Users WHERE Email='$email' AND Password='$password'");
  16. if (mysql_fetch_array($p) != 0){
  17. $registered = mysql_query("SELECT * FROM Users WHERE Email='$email'");
  18. setcookie("PeopleHubLogged", ".$email.");
  19. $users = mysql_fetch_array($registered);
  20. echo "<font color='green'>Hello " . $users['FirstName'] . "! <br>You're logged in! Click the picture that looks like a house to begin!</font>";
  21. } else { echo "<font color='red'>You might need to check those details. They seem to be wrong.</font>"; }
  22.  
  23.  
  24. } else { echo "<font color='red'>You need to enter a password!</font>"; }
  25.  
  26. } else { echo "<font color='red'>You need to enter a email!</font>"; }
  27.  
  28. }
  29.  
  30. }
  31.  
  32.  
  33.  
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment