I attempted to create a members only area, When I try to register,
The link to sign up works, however when I try to login
The same link to sign up doest work (I guess the variable $IsUserLoggedIn is faslse)
Here is the code setting that variable is the user is sucessfully logged (in my header.php file)
PHP Code:
// Run a quick check to see if we are an authenticated user or not  
// First, we set a 'is the user logged in' flag to false by default.  
$isUserLoggedIn false;  
$session session_id();
$query "SELECT * FROM users1 WHERE session_id = '".$session."' LIMIT 1";  
$userResult mysql_query($query) or die ("Error in query: $query. ".mysql_error()); 
mysql_num_rows($userResult) == 1){  
$_SESSION['user'] = mysql_fetch_assoc($userResult);  
$isUserLoggedIn true;
"<span>Welcome ".$_SESSION["user"]["username"]."</span>"
"<li><a href=\"/masterasp/logout.php\">Logout</a></li>";
} else {  
"<li><a href=\"/masterasp/login.php\">Login</a></li>";
"<li><a href=\"/masterasp/register.php\">Register</a></li>";

Here is my code for become_a_provider.php.
PHP Code:
<?php if($isUserLoggedIn) { ?>
<h2>Become a provider</h2>
<?php } else { ?>
<p>In order to become a provider, you must be logged in.  Reqistration is free and takes only a second,  <a href="../register.php">register</a> or <a href="../login.php">login</a>.</p>
<p align="center"><img src="../images/sad.jpg" alt="I'm sad" class="result"></p>
<?php ?>
I dont understand why that variable is true upon registration, but not on the login screen
shouldn't it be?