RE: [PHP] Session problem

From: Date: Tue, 07 Aug 2001 14:50:13 +0000
Subject: RE: [PHP] Session problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-61632@lists.php.net to get a copy of this message
Done, still not working. I know that usually has to be there, I was just going to copy the example from the manual directly, since the session should automatically kickoff when it hits the session_register bit. This truly has me baffled. Chad -----Original Message----- From: hassan el forkani [mailto:webmaster@warmafrica.com] Sent: Tuesday, August 07, 2001 9:37 AM To: Chad Day Cc: php-general@lists.php.net Subject: RE: [PHP] Session problem oh i forgot!!! you have to put this at the beginning of your page <?php session_start(); ?> indeed it's not working properly, first of all please make sur the pages are not cashed send a header (Cache-control: NO cache) i'm not sure about the syntax so check the manual then try to modify your code like this and tell us what happens: <?php if (!HTTP_SESSION_VARS['count']) { global $count; $count = 0; session_register ("count"); echo "Hello visitor, you have seen this page $count; times"; } else { $count = HTTP_SESSION_VARS['count']; $count++; session_register ("count"); echo "Hello visitor, you have seen this page ".HTTP_SESSION_VARS['count']"."; times"; ?> might seem a little overloaded but it's to make sur there is no confusion between count as a session var and the other var; if this is not working then the problem is else whrere and w'll continue lokkin :)) regards At 15:41 07/08/01, you wrote: >Still loses it .. check this out: > >http://www.militarycity.com/classified/realtors/count.php > >The entire code for that page, taken from an example on zend: > ><?php >session_register ("count"); >$count++; >?> > >Hello visitor, you have seen this page <?php echo $count; ?> times.<p> > > >Try loading it about 10 times or so, watch what happens. > >Chad > >-----Original Message----- >From: hassan el forkani [mailto:webmaster@warmafrica.com] >Sent: Tuesday, August 07, 2001 8:34 AM >To: Chad Day >Subject: RE: [PHP] Session problem > > >hello > >At 15:16 07/08/01, you wrote: > >My code: > > > > > > auth.php: > > > > > > session_start(); > > > > > > ... > > > > > > $res = mysql_query("SELECT NAME FROM dbhere where EMAIL = '$EMAIL' AND > > > PASSWORD = '$PASSWORD'"); > > > > > > if ($row = mysql_fetch_array($res)) { > >//try adding this: > global $NAME; > > > > $NAME = $row[NAME]; > > > session_register("NAME"); > > > } > > > > > > ... > > > > > > Header("Location: menu.php"); > > >regards -- 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 (#61632) next »