Re: [PHP] Sessions and switching between php and htm documents
Did you register de variable? look for session_register() in the manual. You can see this articles too: http://www.phpbuilder.com/columns/mattias2312.php3 http://www.phpbuilder.com/columns/mattias2105.php3 William. El mar, 26-02-2002 a las 23:36, Dave escribió: login.htm form submits information login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; header(Location: displaypage.htm); displaypage.htm show some static stuff links to formpage.htm formpage.htm form submits information to form.php form.php session_start(); echo $HTTP_SESSION_VARS[username]; - has no value Does the chain of pages have to be continually PHP pages to allow the transition of the session variables? if not, any ideas on why we are losing session variables? Dave _ Do You Yahoo!? Get your free yahoo.com address at http://mail.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and switching between php and htm documents
tested the $HTTP_SESSION_VARS prior to sending, set just fine. changed the next page to php and tested for the session var... nothing. [in login.php] ? session_start(); # database check in here if(match){ $HTTP_SESSION_VARS[UserID_session]=$txtUserID; #from form field for user $HTTP_SESSION_VARS[UserNum_session]=$databaseresult; # from database result for user number header(Location: successlogin.php); # or .htm - changed this to test if var was being passed exit; }else{ header(Location: wrongpassword.htm); exit; } ? [in successlogin.php] ? echo $HTTP_SESSION_VARS[SellerID_session]; ? if I check session_id() - it is the same in both pages. Variables just aren't getting stored/retrieved. ideas? as an aside, how do you destroy/start a new session with new session id? or do you just destroy the variables then use the same session id for the new session? Dave Did you test and make sure the variable is set? login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; echo $HTTP_SESSION_VARS[username] header(Location: displaypage.htm); Also, for grins ang giggles, make the middle page in the chain a HP, start the session and test for the variable. If it does not work then the problem is not the middle page being html. Subject: [PHP] Sessions and switching between php and htm documents login.htm form submits information login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; header(Location: displaypage.htm); displaypage.htm show some static stuff links to formpage.htm formpage.htm form submits information to form.php form.php session_start(); echo $HTTP_SESSION_VARS[username]; - has no value -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and switching between php and htm documents
Did you test and make sure the variable is set? login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; echo $HTTP_SESSION_VARS[username] header(Location: displaypage.htm); Also, for grins ang giggles, make the middle page in the chain a HP, start the session and test for the variable. If it does not work then the problem is not the middle page being html. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Dave [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions and switching between php and htm documents login.htm form submits information login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; header(Location: displaypage.htm); displaypage.htm show some static stuff links to formpage.htm formpage.htm form submits information to form.php form.php session_start(); echo $HTTP_SESSION_VARS[username]; - has no value Does the chain of pages have to be continually PHP pages to allow the transition of the session variables? if not, any ideas on why we are losing session variables? Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Sessions and switching between php and htm documents
Not HP!!! HTML!!! ( I HATE Outlook's spellchecker sometimes.) =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Cal Evans [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:46 PM To: Dave; [EMAIL PROTECTED] Subject: RE: [PHP] Sessions and switching between php and htm documents Did you test and make sure the variable is set? login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; echo $HTTP_SESSION_VARS[username] header(Location: displaypage.htm); Also, for grins ang giggles, make the middle page in the chain an HTML, start the session and test for the variable. If it does not work then the problem is not the middle page being html. =C= * * Cal Evans * Journeyman Programmer * Techno-Mage * http://www.calevans.com * -Original Message- From: Dave [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 26, 2002 10:37 PM To: [EMAIL PROTECTED] Subject: [PHP] Sessions and switching between php and htm documents login.htm form submits information login.php session_start(); $HTTP_SESSION_VARS[username]=$formUserName; header(Location: displaypage.htm); displaypage.htm show some static stuff links to formpage.htm formpage.htm form submits information to form.php form.php session_start(); echo $HTTP_SESSION_VARS[username]; - has no value Does the chain of pages have to be continually PHP pages to allow the transition of the session variables? if not, any ideas on why we are losing session variables? Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php