Guest User

Untitled

a guest
Jan 28th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors', 1); error_reporting(~0);
  3.  
  4. if (isset($_POST['email']))
  5. {
  6. if(isset($_POST['password'])){
  7.  
  8. }
  9. require_once 'connect.php';
  10. $email = $mysqli->escape_string($_POST['email']);
  11. $password = $mysqli->escape_string($_POST['password']);
  12. $result = $mysqli->query("SELECT * FROM users WHERE email='$email'");
  13. if ($result->num_rows == 0){
  14. header("location: error_page.php");
  15. }
  16. else {
  17. $user = $result->fetch_assoc();
  18. if (password_verify($password, $user['password'])){
  19. $_SESSION['id'] = $login['id'];
  20. $_SESSION['email'] = $loging['email'];
  21. header("location: welcome.php");
  22. }
  23. }
  24. }else{
  25. header("location: error_page.php");
  26. exit();
  27. }
  28.  
  29. ?>
Add Comment
Please, Sign In to add comment