Advertisement
Guest User

Untitled

a guest
Jul 7th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. global $wpdb;
  2.  
  3.  
  4.  
  5.  
  6. if($_SERVER["REQUEST_METHOD"] == "POST")
  7.  
  8.  
  9.  
  10. {
  11.  
  12. $username = $wpdb->escape($_REQUEST['username']);
  13.  
  14. $password = $wpdb->escape($_REQUEST['password']);
  15.  
  16.  
  17. $_SESSION['username'] = $username;
  18.  
  19.  
  20. $wpdb->get_results("select * from wp_registration where Email='$username' AND Password='$password'");
  21. $count= $wpdb->num_rows;
  22.  
  23. if($count == 1) {
  24. header('Location: index.php');
  25. }
  26.  
  27. else {
  28. echo"<script>alert('Incorrect Username or Password!')</script>";
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement