Code: Select all
//Checks if there is a login cookie
if(isset($_COOKIE['ID_my_site']))
//if there is, it logs you in and directes you to the members page
{
$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 ($pass != $info['password'])
{ ?>
<form action="login.php" method="post" STYLE="margin: 0px; padding: 0px;">
<input name="username" type="text" id="username" value="Username" onFocus="if (this.value==this.defaultValue) this.value='';" />
<input name="password" type="password" id="password" value="Password" onFocus="if (this.value==this.defaultValue) this.value='';"/><br>
<a href="members.php" title="Members Area" target="content">Members Area</a> | <a href="registration.php" title="Register" target="content">Register</a>
<input type="submit" id="login" name="login" value="Login" />
</form>
<? }
else
{
echo "Welcome";
}
}
} ?>
//html for rest of site down here
Thanks for any help,
Josh.