QUOTE
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Diva Spa :: Your Escape To Beauty</title>
<style type="text/css">
<!--
.style3 {font-size: x-small}
.style4 {
color: #FFFFFF;
font-size: 10px;
}
.style5 {font-size: 10px}
.style6 {
font-size: 12px;
color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
}
.style7 {font-family: Arial, Helvetica, sans-serif}
-->
</style>
</head>
<body>
<div id="container">
<div id="header"></div>
<div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="index.html" id="current">Home</a></li>
<li><a href="services.php"> Services</a></li>
<li><a href="specialoffers.php">Special Offers</a></li>
<li><a href="reservations.php">Reservation</a></li>
<li><a href="aboutus.php">About Us</a></li>
</ul>
</div>
<div id="wrapper">
<div id="left">
<ul class="list">
<li><a href="#">vertical links</a></li>
<li><a href="#">vertical links</a></li>
<li><a href="#">vertical links</a></li>
<li><a href="#">vertical linksr</a></li>
</ul>
</div>
<div id="right">
<p><?php
// Connects to your Database
mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("spa") or die(mysql_error());
//checks cookies to make sure they are logged in
if(isset($_COOKIE['ID_my_site']))
{
$username = $_COOKIE['ID_my_site'];
$pass = $_COOKIE['Key_my_site'];
$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());
while($info = mysql_fetch_array( $check ))
{
//if the cookie has the wrong password, they are taken to the login page
if ($pass != $info['password'])
{ header("Location: login.php");
}
//otherwise they are shown the admin area
else
{
echo "Admin Area<p>";
echo "Your Content<p>";
echo "<a href=logout.php>Logout</a>";
}
}
}
else
//if the cookie does not exist, they are taken to the login screen
{
header("Location: login.php");
}
?>
</p>
</div>
<div id="content">
<h1>Special Offer For December</h1>
<p><script src="flashLoad.js" type="text/javascript"></script>
<script>loadFlash("specialoffer.swf", 400, 100, "swf/")</script></p>
See the details on <a href="specialoffers.php">Special Offers
</a>
<h2>Reservations Available</h2>
<p>We have added Reservation Menu for you, our loyal customers. Easier and faster booking to your beauty! Registered as a member is required. Click here to Register or <a href="reservations.php">Reserve</a> your place now!<br />
As always, your suggestions and feedbacks are highly appreciated for our future development.</p>
</div>
</div>
</div>
<p align="center"><span class="style3"><span class="style5"><span class="style6"><strong>Hours of Operation:</strong><br />
Monday through Friday from 10am-6pm |
Saturdays by Appointment<br />
Diva Spa: 1403 W. 47th St.
<strong>Phone: </strong>512-420-8106 </span></span></span>
</p>
</p>
<p align="center" class="style4"><span class="style7">Home | Services | Special Offers | Reservations | About Us<br />
<strong>Content: © 2008 Diva Spa: All Rights Reserved </strong></span></p>
</body>
</html>
this is the whole index page.
is there something wrong with the cookie?