Sessions & Header PROBLEM again!
| From: | Alessandro BOSSI | Date: | Fri, 02 Nov 2001 14:49:48 +0000 |
| Subject: | Sessions & Header PROBLEM again! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-73266@lists.php.net to get a copy of this message | ||
Why in these 3 linked page the var "count"
does not go through the page if I have the browser sessions disabled???
Where is the mistake?
I see the session_id, changing at every page!
Someone can help me?
Many thank
Alessandro Bossi
---------------------------------
<?php /* First.php */
session_name(mysession);
session_start();
session_register ("count");
if (isset($submit)){
header("Location: Seconda.php?".SID);
}else{
$count++;
}
print "session_encode=>> ".session_encode()."<BR>";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE> First Page</TITLE></HEAD>
<BODY BGCOLOR="#A2BBAF">
<H4>First Page</H4>
Hello visitor, you have seen this page <?=$count; ?> times.<p>
count = <?= $HTTP_SESSION_VARS["count"] ?><BR>
<P>
<FORM METHOD=POST ACTION="<?= $PHP_SELF ?>">
<INPUT TYPE="hidden" NAME="count" value="<?=$count?>">
<INPUT TYPE="submit" name=submit value="Go to the SECOND page">
</FORM>
</BODY></HTML>
---------------------------------
<?php /* Second.php */
session_name(mysession);
session_start();
session_register('count');
if (isset($submit)){
header("Location: Third.php?".SID);
}
print "session_encode=>> ".session_encode()."<BR>";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Second Page</TITLE></HEAD>
<BODY BGCOLOR="#A2BBAF">
<H4>Second Page</H4>
Hello visitor, you have seen this page <?=$count; ?> times.<p>
count = <?= $HTTP_SESSION_VARS["count"] ?>
<P>
<FORM METHOD=POST ACTION="<?= $PHP_SELF ?>">
<INPUT TYPE="submit" name=submit value="Go to the THIRD Page ">
</FORM>
</BODY>
</HTML>
---------------------------------
<?php /* Third.php */
session_name(mysession);
session_start();
session_register ("count");
if (isset($submit)){
header("Location: First.php?".SID);
}
print "session_encode=>> ".session_encode()."<BR>";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Third Page</TITLE>
</HEAD>
<BODY BGCOLOR="#A2BBAF">
<H4>Third Page</H4>
Hello visitor, you have seen this page <?=$count; ?> times.<p>
Count = <?= $HTTP_SESSION_VARS["count"] ?>
<P>
<FORM METHOD=POST ACTION="<?= $PHP_SELF ?>">
<INPUT TYPE="submit" name=submit value="Go to the FIRST Page ">
</FORM>
</BODY>
</HTML>