Re: How can I get my session variable to pass to another page?

From: Date: Sat, 27 Jul 2002 09:20:55 +0000
Subject: Re: How can I get my session variable to pass to another page?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-109940@lists.php.net to get a copy of this message
you have to add: session_start() in your second file. "Donpro" <donpro@lclcan.com> wrote in message news:005001c234df$fe6e7b80$c889cdcd@lclcan.com... > Hi, > > I have a form that calls a PHP script which sets a session variable and > redirects to anopther URL as such: > > session_start(); > $HTTP_SESSION_VARS['userid'] = "someidnumber"; > Header('Location: ' . > 'http://www.mydomain.com/welcome.html'); > > On welcome.html, I have the following code: > > <script language="php"> > echo 'userid: ' . $HTTP_SESSION_VARS['userid'] . '<br/>'; > </script> > > When I run it in my browser, the value of 'userid' is empty. Anyone know > why? > >

« previous php.general (#109940) next »