Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2. if (isset($_POST['btnok'])) {
  3. $login = $_POST['login'];
  4. $password = $_POST['password'];
  5. mysql_connect('localhost','root','root');
  6. echo "2";
  7. mysql_select_db('hack');
  8. echo "3";
  9. $login = $_POST['login'];
  10. $password = $_POST['password'];
  11.  
  12. $re = mysql_query("select * from users where login = '$login' and password = '$password'");
  13. echo "re :";
  14. echo $re;
  15. if(mysql_num_rows($re) != 0){
  16. $temps = 365*24*3600;
  17. setcookie ("credentials", $login.":".$password, time() + $temps);
  18. header('Location: ./home.php');
  19. } else {
  20. $_SESSION['error'] = true;
  21. header('Location: ./login.php');
  22. }
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement