Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2. $username="webuser";
  3. $password="";
  4. $database="assassin";
  5.  
  6. //connection line
  7. $connected = mysql_connect(localhost,$username,$password);
  8. if (!$connected) {
  9.     die('Could not connect: ' . mysql_error());
  10. }
  11.  
  12. //selects database
  13. mysql_select_db($database, $connected) or die('Unable to select database: ' . $mysql_error());
  14. $codeid = $_POST['codeid'];
  15. $password = $_POST['password'];
  16.  
  17. $query2 = "SELECT password FROM users WHERE codeid = '.$codeid';";
  18. $password_found = mysql_query($query2);
  19. $password_found = mysql_fetch_array($password_found);
  20. echo $password_found;
  21. if ($password_found == $password)
  22. {
  23. //user session info, UID
  24. $_SESSION['codeid'] = $codeid;
  25.     header('Location: landing.html');
  26. }
  27. else
  28. {
  29. print "Incorrect user or password!";
  30. header('Location : index.html');
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement