RE: [PHP] Sessions just don't work on my machine. (Trying this ag ain)

From: Date: Mon, 24 Sep 2001 17:15:30 +0000
Subject: RE: [PHP] Sessions just don't work on my machine. (Trying this ag ain)
Groups: php.general 
Request: Send a blank email to php-general+get-68570@lists.php.net to get a copy of this message
OK, now the session ID is getting passed like it should. Now for the two missing variables. Try moving the two assignment statements ahead of the two session_register() calls - "assign, then register". I have never seen this make a difference, but the pros on this list say that is the way it needs to be done. Kirk > -----Original Message----- > From: Thomas Deliduka [mailto:thomas@neweve.com] > Sent: Monday, September 24, 2001 11:01 AM > To: PHP List > Subject: Re: [PHP] Sessions just don't work on my machine. > (Trying this > ag ain) > > > On 9/24/2001 1:05 PM this was written: > > > On Monday 24 September 2001 18:51, Thomas Deliduka wrote: > >> I'm finding my script on www.fromtheduke.com/session/ still doesn't > >> work even with the <?=SID?> in the link or passing it along in the > >> form. > > Please send us your latest code again, then we can help > you, not just > > guessing what you've might done. > > Latest code: > index.php: > <? > error_reporting(E_ALL); > session_start(); > > session_register("var1"); > session_register("var2"); > > $var1 = "My var 1"; > $var2 = "My var 2"; > > ?><HTML> > <HEAD> > <TITLE>Session Page 1</TITLE> > </HEAD> > > <BODY BGCOLOR=#FFFFFF> > > PHPSESSID: <? echo $PHPSESSID; ?><BR> > Var1: <? echo $var1; ?><BR> > Var2: <? echo $var2; ?><BR> > > <FORM ACTION="index2.php" METHOD="POST"> > Passing sessid: <INPUT TYPE=TEXT VALUE="<? echo $PHPSESSID; > ?>" SIZE=40 > NAME="PHPSESSID"><BR> > VAR 3: <INPUT TYPE=TEXT VALUE="My Var 3" NAME="myvar3"> > <INPUT TYPE=SUBMIT > VALUE="go"><BR> > </FORM> > <BR> > <A HREF="index2.php?<?=SID?>">Try this link</A> > </BODY> > </HTML> > > ---------------- > index2.php: > <? > error_reporting(E_ALL); > session_start(); // start session > session_register("var3"); // register var 3 session variable > > $var3 = $myvar3; > ?><HTML> > <HEAD> > <TITLE>Session Page 2</TITLE> > </HEAD> > > <BODY BGCOLOR=#FFFFFF> > > PHPSESSID: <? echo $PHPSESSID; ?><BR> > Var1: <? echo $var1; ?><BR> > Var2: <? echo $var2; ?><BR> > VAR3: <? echo $var3; ?><BR> > > </BODY> > </HTML> > -- > > Thomas Deliduka > IT Manager > ------------------------- > New Eve Media > The Solution To Your Internet Angst > http://www.neweve.com/ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.general (#68570) next »