Advertisement
Guest User

Untitled

a guest
Feb 11th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. <?php
  2. require 'config.php';
  3.  
  4. $conn = new PDO('mysql:host='.$serveraddr.';dbname='.$database.';', $user,$password);
  5.  
  6. if (isset($_POST['Login'])) {
  7. $username = $_POST['email'];
  8. $password = $_POST['password'];
  9.  
  10. $query = $conn->prepare("SELECT * FROM `users` WHERE email=:username AND pass=:password");
  11. $query->execute(array(':username' => $username, ':password' => $password));
  12.  
  13. if ($query->rowCount()>0) {
  14. $_SESSION['username'] = $username;
  15. header('location: home.php');
  16.  
  17.  
  18. }
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement