Hello, I try to call a header A if a user is logged in, and a header B if a user is not logged in on some pages
I haven't managed to do so, I've tried to create a php function, but didn't manage to make it work. Then, I setup a connection to the mySql database just to check if 0 users are connected (or 1), but it didn't work. This just includes the header in the if clause
$result = mysql_query("SELECT * FROM members
WHERE username = '$username'");
if (mysql_num_rows($result) == 0)
{
include ("header.php");
}
else
include ("loginHeader.php");
?>
can anyone help me with this? Is it easier to solve as above with mySql or is it easier to create a php function and then call it on the respective page?