how do i make the script so if they are loged it the script continues if it doesnt it dies
It doesn't display anything, because it is doing precisely what you asked for it to do... it dies.
Now, if you know that you are logged in and it is dying, then that is a different matter.
If you are wanting to be a little more fancy and give a 'not logged in' error message, then do something like this:
<?
if (isset($_COOKIE['uname'])) {
$username = $_COOKIE['uname'];
$password = $_COOKIE['password'];
$sql0 = mysql_query("SELECT * FROM author WHERE username='$username' AND password='$password' AND activated='1'");
$login_check = mysql_num_rows($sql0);
if($login_check > 0) {
while($row = mysql_fetch_array($sql0)) {
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
mysql_query("UPDATE author SET last_login=now() WHERE id='$id'");
}
}
} else {
echo '<b>Error:</b> You are not logged in. Drop dead.';
die();
}
}else {
echo '<b>Error:</b> You do not have a cookie set. This makes the Cookie Monster upset. Drop dead.';
die();
}
?>
I hope that my humor comes through alright in this. It's late, so perhaps I'm suffering the effects of sleep deprivation. 😃