Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("connect.inc");
- $name=$_POST['username'];
- $pass=$_POST['password'];
- $remember=$_POST['remember'];
- $encryptedpass= md5($pass);
- $recordsfound;
- function totalrecords($name, $pass) {
- include('connect.inc');
- global $recordsfound;
- $total = mysql_query("SELECT COUNT(*) FROM users WHERE User='$name' AND Password='$pass' AND Access='1'", $conn) or die(mysql_error());
- $row = mysql_fetch_row($total);
- $recordsfound = $row[0];
- }
- totalrecords($name, $pass);
- if ($remember == remember) { $cookielength = time() + 500*24*60*60 ; }
- else { $cookielength; }
- if ($recordsfound == 1) {
- setcookie(name, "$name", $cookielength);
- setcookie(pass, "$pass", $cookielength);
- header("location:admin.php");
- } else {
- header("location:login.php");}
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement