I have built a login scheme that registers the username and password with sessions. However, Netscape 4 seems to lose these variables unless they're reposted. I was under the impression sessions maintained the variables as long as session_start() was present. So why is NS4 losing them? Does anyone know of a quirk with NS4 and sessions?
Here's my relevant code:
<?php
// course.php
session_start();
$title = "Freedom Course";
$rightPanel = "../includes/rightCourse.inc";
// I left out the grab_queries and auth_user for space
function login_form() {
session_start();
global $PHP_SELF;
global $title, $rightPanel, $firstname;
include "../includes/header.inc";
include "../course/login.inc";
include "../includes/footer.inc";
}
function extract_article($article) {
$numDay = substr($article,-2);
return $numDay;
}
if(!isset($login_user)) {
login_form();
exit;
}
else {
session_register("login_user");
session_register("login_pass");
$authorized = auth_user($login_user, $login_pass);
if(!$authorized) {
session_unregister("login_user");
session_unregister("login_pass");
include "../includes/header.inc";
include "../course/invalidLogin.inc";
include "../includes/footer.inc";
exit;
}
else {
$email = grab_email($login_user);
session_register("email");
$firstname = grab_firstname($login_user);
session_register("firstname");
$recipient = grab_mentor($login_user);
session_register("recipient");
setcookie ("firstname", $firstname, time() +180 * 86400, "/", ".thenine.com");
if (!$article) {
$article = "welcome.inc";
include "../includes/header.inc";
include "$article";
include "../includes/footer.inc";
}
else {
$numDay = extract_article($article);
include "../includes/header.inc";
echo ("\n<form method=post action='preProcess.php'>\n");
echo ("<input type=hidden name='Name' value='$firstname'>\n");
echo ("<input type=hidden name='User' value='$login_user'>\n");
echo ("<input type=hidden name='email' value='$email'>\n");
echo ("<input type=hidden name='Course' value='Freedom'>\n");
echo ("<input type=hidden name='Day' value='$numDay'>\n");
echo ("<h1>The Freedom Course</h1>\n");
include "$article";
echo ("\n<input type=hidden name='recipient' value='$recipient'>\n");
echo ("<input type=hidden name='subject' value='Freedom_Course:_Response'>\n");
include "WereYouFree.inc";
echo ("<center><input type=submit value=Submit> <input type=reset value=Reset></center>\n</form>\n");
include "../includes/footer.inc";
}
}
}
?>
and the code for rightCourse.inc:
<form method=get action="../course/course.php">
<select name=article class=formText>
<option value="" selected>Choose Day
<?php
$db = mysql_connect("localhost", "php", "php");
mysql_select_db("scf",$db);
$result=mysql_query("SELECT filepath FROM course_freedom ORDER BY course_no",$db);
$numrows = mysql_num_rows($result);
$count = 1;
for ($i = 0; $i < mysql_num_rows($result); $i++) { ?>
<option value="<? echo mysql_result($result,$i,"filepath"); ?>"><? echo ("Day " . $count++ . "\n");} ?>
</select>
<br><br>
<input type=submit value=" go " class=formText>
</form>
--
So course.php rebuilds itself based on the value of $article (acquired through the form in rightCourse.inc) but NS4 loses the $login_pass and $login_user variables. Can anyone help me?