RE: [PHP] About sessions !!

From: Date: Tue, 24 Apr 2001 14:38:42 +0000
Subject: RE: [PHP] About sessions !!
Groups: php.general 
Request: Send a blank email to php-general+get-50091@lists.php.net to get a copy of this message
Thaks !! Work fine !!! Bye !!! -----Original Message----- From: Nicolas Guilhot [mailto:nguilhot@gphy.campus.univ-poitiers.fr] Sent: Tuesday, April 24, 2001 11:25 AM To: Hassan Arteaga Subject: RE: [PHP] About sessions !! This code works just fine for me (with register_globals = ON), so it should for you. If it doesn't then you have a configuration problem. <?php session_start(); if(!isset($HTTP_SESSION_VARS['myvar'])) { $myvar = 1; session_register("myvar"); } ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> </head> <body> Hello visitor, you have seen this page <? echo $myvar++; ?> times.<p> To continue, <A HREF="session1.php">click here</A> </body> </html> -----Message d'origine----- De : Hassan Arteaga [mailto:Hassan.arteaga@fundycs.com] Envoyé : mardi 24 avril 2001 16:23 À : Php (E-mail) Objet : RE: [PHP] About sessions !! ok ..register_globals are on !! Ok $myvar always will be 1 ..but when a try to print it is empty !!!..It is just a test about session. Thanks Nicolas !! -----Original Message----- From: Nicolas Guilhot [mailto:nguilhot@METabolic-EXplorer.com] Sent: Tuesday, April 24, 2001 11:13 AM To: php-general@lists.php.net Subject: RE: [PHP] About sessions !! You should also check if register_globals is set to ON in your php.ini file. Otherwise you can't access you session variable just with $myvar !! And in your code you never increment $myvar, so even if it works, you'll always get 1. Regards, Nicolas Guilhot -----Message d'origine----- De : Yasuo Ohgaki [mailto:yohgaki@hotmail.com] Envoyé : mardi 24 avril 2001 16:11 À : php-general@lists.php.net Objet : Re: [PHP] About sessions !! SID does not work unless you enable trans sid. Regards, -- Yasuo Ohgaki "Hassan Arteaga" <Hassan.arteaga@fundycs.com> wrote in message news:7F548E90E63BD1118E4600609707771F8BEFAF@goliath... Hi !! I just begin with PHP( but is the same as ASP ) and testing some examples... loock at the code: Page 1- Session.php <?php session_start(); $myvar = 1; session_register("myvar"); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> </head> <body> Hello visitor, you have seen this page <? echo $myvar; ?> times.<p> To continue, <A HREF="session1.php">click here</A> </body> </html> ___________________________________________________ Page 2- Session1.php <?php session_start(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> </head> <body> Hello visitor, you have seen this page <?php echo $myvar; ?> times.<p> Your SID is: <?php echo SID; ?> <p> </body> </html> Page 1 is ok..but when I click to go to page 2 I receive this results.. Hello visitor, you have seen this page times. Your SID is: SID Who can tell me what happend !! Thank you in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd Hassan.Arteaga@fundycs.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 -- 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 -- 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 -- 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 (#50091) next »