Re: [PHP-DB] Still stuck on Sessions :-(
I personally tend to use arrays for my sessions, i just find it easier that way this sort of thing works for me:- $SESSION["user"]=$whatever; $SESSION["password"]=$whatever; echo("Welcome ". $SESSION["user"] .", Please Click On A Link"); - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 10:42 PM Subject: [PHP-DB] Still stuck on Sessions :-( Hi there everyone, Thanks to everyone that replied to my session help - but i'm still having problems. I use the below to open a session - Say at the start of my website: where username and pass would be defined by a variable - either from a form or hardcoded. Now, if I use on the SAME page as this is, it displays the varibles, but if I move to another page on the website via a link the session seems to have ended or something as it says $user is undefined. Do I need to add anything to each page where a session is needed so that it grabs the variables before I can use them? Or am I doing something totally stupid? I've tried it on my Win2000 system AND on my Linux server. Please help, I am getting totally frustrated and need to get all this working within 2 weeks :-( Thank you Regards Chris Payne www.planetoxygene.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Still stuck on Sessions :-(
Hi Marios, Unfortunately i'm very new to PHP so i'm not sure how to do some of this (Sorry). Cookies are deffinately enabled. Chris > Firstly, try initializing the variable, and then registering. > Also are you accessing the user and pass variables in a function in the > other pages?...if so do a global $user,$pass > Are cookies enabled on the web browser? > > marios > > - Original Message - > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 18, 2001 11:42 PM > Subject: [PHP-DB] Still stuck on Sessions :-( > > > Hi there everyone, > > Thanks to everyone that replied to my session help - but i'm still having > problems. I use the below to open a session - Say at the start of my > website: > > > session_start(); > > session_register("user"); $user="$username"; > session_register("pass"); $pass="$password"; > > ?> > > where username and pass would be defined by a variable - either from a form > or hardcoded. > > Now, if I use on the SAME page as this is, it displays the > varibles, but if I move to another page on the website via a link the > session seems to have ended or something as it says $user is undefined. Do > I need to add anything to each page where a session is needed so that it > grabs the variables before I can use them? Or am I doing something totally > stupid? I've tried it on my Win2000 system AND on my Linux server. > > Please help, I am getting totally frustrated and need to get all this > working within 2 weeks :-( > > Thank you > > Regards > > Chris Payne > www.planetoxygene.com > >