Hi Suntra,
Thank you for the quick response! I feel that I didn't explain the situation well enough and that it is kind of cryptic...
First, here's the requested code for header.inc
<html><body background=comp025.jpg><center>
<h1>Project</h1>
<Table width=700 cellpadding=10 border=10 bordercolor=black><tr><td align=right bgcolor=red>
<?
if (!$_SESSION['user_id']){
echo ("<a href=login.php>LOGIN</a> | ");
echo ("<a href=register.php>Register</a> | ");
echo ("<a href=forgot.php>Forgot Password?</a>");
}
else {
echo ("<a href=logout.php?".SID.">LOGOUT</a>");
}
?>
<p></td></tr></table>
<table width=700 cellpadding=10 border=10 bordercolor=black><td width=100 valign=top bgcolor=red>
<?
if (!$_SESSION['user_id']){
echo ("<a href=index.php>Home</a><p>");
echo ("<a href=link.php>Links</a>");
}
else {
echo ("<a href=loggedin.php?".SID.">HOME</a><p>");
echo ("<a href=question.php?".SID.">Quiz</a><p>");
echo ("<a href=discussion.php?".SID.">Discussion</a><p>");
echo ("<a href=share_url.php?".SID.">Share URLs</a><p>");
echo ("<a href=link.php?".SID.">More Information</a><p>");
echo("<a href=sum.php?".SID.">Sum</a><p>");
//echo("<a href=hangman.php?".SID.">Hangman</a><p>");
echo("<a href=courses.php?".SID.">Courses</a><p>");
}
?>
</td><td valign=top>
This code does give the user the proper login credentials when passed from one screen to the next, from my testing.
Second, and probably some more explanation... When I do the calculate function on sum.php, I lose the session id since it is calling upon the same file.
Sequence of events: User logs in and is given the custom menu from header.inc. They click on 'sum' in the menu and are directed to the sum page with the session ID in the URL. They type in some numbers, hit caculate, and are given the answer, but the session ID is gone in the URL.
Is this a situation where I should create a custome page for the output to pass the session ID from one page to the next? I have had success doing that in other areas, but just not within the same page.
Thanks again for your thoughts.
Hoot