Advertisement
Guest User

Untitled

a guest
May 4th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. connect.inc
  2.  
  3. <?php
  4.   $server="localhost";
  5.   $user="root";
  6.   $password1="";
  7.   $database="rs";
  8.   $conn=mysql_connect($server,$user,$password1) OR die ('Could not connect to MySQL'.mysql_error());
  9.   mysql_select_db($database, $conn) OR die ('Could not find database'.mysql_error());
  10. ?>
  11.  
  12. login.inc
  13.  
  14. <?php
  15. if (!isset($_COOKIE['name'])) {
  16.   if (!isset($_COOKIE['pass'])) {
  17.   header("location:login.php");  }
  18.   } else {
  19. include('connect.inc');
  20. $name=$_COOKIE['name'];
  21. $pass=$_COOKIE['pass'];
  22. $result = mysql_query("SELECT COUNT(*) FROM customer WHERE Username = '$name' AND CustomerPassword='$pass'") or die(mysql_error());
  23.   $row = mysql_fetch_row($result);
  24.   $amountfound = $row[0];
  25.   if ($amountfound!=1) { header("location:login.php"); } }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement