Advertisement
Guest User

Untitled

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