Advertisement
Guest User

checklogin.php

a guest
Dec 19th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. <?php
  2. require_once 'dbinfo.php';
  3. require_once 'functions.php';
  4.  
  5. session_start();
  6.  
  7.  
  8.  
  9. if(isset($_POST['login'])) {
  10. $usr=$_POST['usr'];
  11. $password=$_POST['password'];
  12. $sql= "SELECT * FROM members WHERE usr='".$usr."'AND password='".$password."' LIMIT 1";
  13. $res=mysql_query($sql);
  14. if (mysql_num_rows($res) == 1) {
  15. header("Location: mainpage.php");
  16. $_SESSION['usr'] = $usr;
  17.  
  18. exit();
  19. }else {
  20. echo"Invalid login information";
  21. exit();
  22. }
  23. }
  24.  
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement