Advertisement
Guest User

Untitled

a guest
May 9th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. <?php
  2. include("connect.inc");
  3. $name=$_POST['username'];
  4. $pass=$_POST['password'];
  5. $remember=$_POST['remember'];
  6. $encryptedpass= md5($pass);
  7. $recordsfound;
  8. function totalrecords($name, $pass) {
  9. include('connect.inc');
  10. global $recordsfound;
  11.   $total = mysql_query("SELECT COUNT(*) FROM users WHERE User='$name' AND Password='$pass' AND Access='1'", $conn) or die(mysql_error());
  12.   $row = mysql_fetch_row($total);
  13.   $recordsfound = $row[0];
  14. }
  15. totalrecords($name, $pass);
  16. if ($remember == remember) { $cookielength = time() + 500*24*60*60 ; }
  17. else { $cookielength; }
  18. if ($recordsfound == 1) {
  19. setcookie(name, "$name", $cookielength);
  20. setcookie(pass, "$pass", $cookielength);
  21. header("location:admin.php");
  22.  } else {
  23.  header("location:login.php");}
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement