Don't know offhand what the problem is, but a couple thoughts:

1. Why are you using session_name(mysession) instead of 
session_name('mysession')?

2. Assuming you have register_globals on, you're trying to pass $count 
both as a session variable and a post variable. One of these is going to 
get overwritten by the other if I'm not mistaken.

3. Why not have the page 1 form action point directly at page 2 instead 
of being redirected through page 1? Do posted variables follow a 
redirect?

4. If posted variables do follow a redirect then page 1 will see that 
$submit is set and redirect to page 2, which will redirect to page 3, 
which will redirect to page 1, etc... Can you get an infinite 
redirection loop?

5. The form on page 1 includes a hidden count variable, page 2 and page 
3 don't.

What happens when you run this?

-Steve

On Friday, November 2, 2001, at 08:49  AM, Alessandro BOSSI wrote:

> 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>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to