I am createing a simply quiz site, where in order to participate in the quiz, you must first be logged in.
While working on my local machine, the code works perfectly.
I use the followin to create a session ID;
$_SESSION['SESS_ID'] = $member['id'];
Then, on my main page where i want dynamic code i include the following;
if(!isset($_SESSION['SESS_ID']) || (trim($_SESSION['SESS_ID']) == '')) {
print ("
<div style='float:left; width:400px; height:215px; margin-left:500px;'>
<form class='login' method='post' action='login-form.php' style='float:right; margin-top:120px;' >
<input type='submit' class='button' name='submit' value='Sign In' style='float:right ; margin-right:20px;'>
</form>
<p style=' margin-top:170px; margin-left:160px;'>New Member? Start <a href='register-form.php'>Here</a></p>
</div>
"
);
}
else {
print "<h4 style='float:right; text-align: right; margin-top:150px; margin-right:50px;'>Welcome ". $_SESSION['SESS_NAME']. " <a href='logout.php' style='float:right; text-align:right;'>Sign Out</a></h4>
";
For some reason, when the site is on the server, the session ID does not seam to get passed along.
Any Ideas how to remediy this?
the website is kingdomquiz.com if anybody is interested.