Advertisement
Guest User

Untitled

a guest
Feb 28th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. global $dblocalhost;
  2.  
  3. $button = filter_input(INPUT_POST,'click');
  4. if(isset($button)){
  5.  
  6. $mail = filter_input(INPUT_POST,'email');
  7. $pass = filter_input(INPUT_POST,'pass');
  8.  
  9. $email = mysql_real_escape_string($dblocalhost,$mail);
  10. $password = mysql_real_escape_string($dblocalhost,$pass);
  11.  
  12. $queri = "SELECT * FROM user-data WHERE email ='$email'" or die("error query");
  13.  
  14. if(!$queri){
  15.  
  16. die('nope'.mysqli_error($queri));
  17.  
  18.  
  19. }
  20. $output = mysqli_query($dblocalhost,$queri);
  21. while($check = mysqli_fetch_array($output)){
  22.  
  23. $user = $check['email'];
  24. $userpass = $check['password'];
  25.  
  26. }
  27.  
  28. if ($email == $user && $password == $userpass){
  29.  
  30.  
  31. $_SESSION['email'] = $user;
  32. $_SESSION['password']= $userpass;
  33.  
  34. header("Location: dashbo.php");
  35.  
  36. exit();
  37.  
  38. } else{
  39. header('Location: login.php?error');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement