hi all my intention is to allow a login box to be on every page of my site now i have accomplished this bit however i want the login box to dissapear and stay away if the user is logged in but i want it to state that they are logged in and who as. + any other info i add in as i go on...
below is the if statment i have created $hvgLogins is the cookie var created once logged in and result is the username from the table... strange way of doing it i know but i could not find any other way of doing it with my minimal knowledge of all this.
but any way my if does not display weather they are logged in or not it allways comes up with the login under the else statment?
know its a semi simple code problem but cannot find which bit is the problem.
Thanks
<?
include "./includes/dbconnect.php.inc" ;
$result = "mysql_query(select username from hvgUsers where username = $hvgLogins)" ;
if ($hvgLogins == $result)
{
echo ("You are logged in as ".$hvgLogins);
}
else
{
echo "<form action=./users/processlogin.php method=post name=Login id=Login>";
echo "<p align='center' class='style1'> <span class='style6'>Username: </span>";
echo "<input name='username' type='text' id='username' size='10'>";
echo "</p>";
echo "<p align='center' class='style1'><span class='style7'>Password:";
echo "</span>";
echo "<input name='password' type='text' id='password' size='10'>";
echo "</p>";
echo "<p align='center' class='style1'>";
echo "<input type='submit' name='Submit' value='Submit'>";
echo "<br>";
echo "</p>";
echo "</form>";
}
?>
Thanks for the help in advance.