Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.71 KB | None | 0 0
  1. <?php
  2. $username="webuser";
  3. $password="dyeHD3js69bLnc5G";
  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_result($query2,0);
  19.  
  20. if ($password_found == $password)
  21. {
  22. //user session info, UID
  23. $_SESSION['codeid'] = $codeid;
  24.     header('Location: landing.html');
  25. }
  26. else
  27. {
  28. print "Incorrect user or password!";
  29. header('Location : index.html');
  30. }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement