Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- connect.inc
- <?php
- $server="localhost";
- $user="root";
- $password1="";
- $database="rs";
- $conn=mysql_connect($server,$user,$password1) OR die ('Could not connect to MySQL'.mysql_error());
- mysql_select_db($database, $conn) OR die ('Could not find database'.mysql_error());
- ?>
- login.inc
- <?php
- if (!isset($_COOKIE['name'])) {
- if (!isset($_COOKIE['pass'])) {
- header("location:login.php"); }
- } else {
- include('connect.inc');
- $name=$_COOKIE['name'];
- $pass=$_COOKIE['pass'];
- $result = mysql_query("SELECT COUNT(*) FROM customer WHERE Username = '$name' AND CustomerPassword='$pass'") or die(mysql_error());
- $row = mysql_fetch_row($result);
- $amountfound = $row[0];
- if ($amountfound!=1) { header("location:login.php"); } }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement