Re: [PHP3] php4:probs with session vars
| From: | fredo | Date: | Wed, 14 Jun 2000 21:58:36 +0000 |
| Subject: | Re: [PHP3] php4:probs with session vars | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1880@lists.php.net to get a copy of this message | ||
make all session vars global and put register_globals = on in php.ini
this should fix it
"Navneet Kumar" <navatoff@SoftHome.net> wrote in message
news:NEBBJPHMBDFPHGNEHKJKKEGHCDAA.navatoff@SoftHome.net...
> hi
>
> pretty new to php4, i'm trying the beauty of sessions. i got the PHP4
parser
> compiled and implemented with '--enable-trans-sid' param so that the sid
is
> retained without me explicitely passing it with querystring or hidden
fields
> and it works just fine but where i fail to get it working is when i need
to
> work with session variables, they just don't seem to retain the values!
here
> is sample code:
>
> 1.php4
> =====
> <?
> session_start();
> $UserName; file://global
> $UserName="asd";
> session_register("UserName");
>
> header("Location:2.php4");
> ?>
>
>
> 2.php4
> =====
> <?
> session_start();
> file://global $UserName;
> file://session_register("UserName");
> if (session_is_registered("UserName")) {
> echo $UserName . " test";
> }
> session_destroy();
> ?>
>
>
> I have tried declaring UserName as global in the first script and also in
> the second script and also tried redclaring them but to no avail. please
> help!!
>
> thanx
> porky
>
>
> --
> PHP 3 Mailing List <http://www.php.net/>
> To unsubscribe, send an empty message to php3-unsubscribe@lists.php.net
> To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net
> To search the mailing list archive, go to:
http://www.php.net/mailsearch.php3
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>