Ok this is a great question for you.....
function welcome() {
if ($_HTTP_COOKIE_VARS['user']) {
$sql = "SELECT fname FROM users WHERE user='$name'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result) or die(mysql_error());
$fname = $row['fname'];
} else {
$fname = "Guest - <a href=loginbox.php>Login";
}
echo "Welcome, $fname";
}
this is my code.. However it does not work correctly.. it always displays $fname= "Gest" login .. and not the other part.... HOwever i know that the cookie named user is present.
When i change if(!$HTTP_COOKIE_var['user'] the screen goes white.. and will not post anything.. or if i use $_COOKIE it does the same thing. And the code up top doens't even read the cookie.
Any suggestions?
Thank you
Anthony