[EMAIL PROTECTED] (David Rice) writes:
> I have been having trouble with PHP sessions, the session variables
> are not able to be called through the script.
> If have commented the area at the bottome where the session variable
> is NULL when var dump is called to check it (about 20 lines from the
> bottom... depending on if the text is wrapping or not)
[ snip ]
> <?
>       session_start();
>       session_register('valid_user');
>       session_register('name');
>       /* Start A Session */

- Is register_globals on or off?
- Which PHP version?

In PHP 4.2, I think, you have to use $_SESSION["foo"] = "bar" instead
of session_register("foo") if register_globals is off. This is afaicr
fixed in 4.3.

[ snip ]
>               <form name="register" method="post" action="<? echo $PHP_SELF; ?>">
>                       <?
[ snip ]
>                       session_register('valid_user');

You can't register a session variable after output. You have already
registered it, just set $valid_user = 'something'.

I might not remember everything completely, but the manual will at
least give you the correct answers if mine are wrong. ;-)

In an organization, each person rises to the level of his own
                -- The Peter Principle

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to