Re: Using and Echoing Session Variables

From: Date: Sun, 18 Jul 2004 10:30:12 +0000
Subject: Re: Using and Echoing Session Variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-190897@lists.php.net to get a copy of this message
OK, so here's my conundrum... After verifying the user and pulling all fields from the record I declare two variables (just testing here): $_SESSION['UserID'] = UserID; $_SESSION['FurtherComments'] = FurtherComments; on the next page I start a session, everything OK. I echo the UserID variable - fine. But the FurtherComments variable simply echoes "FurtherComments" even though there's a database field called "FurtherComments". Strange one... -- ----------------------------- Michael Mason Arras People www.arraspeople.co.uk ----------------------------- "Harlequin" <michael.mason@arraspeople.co.uk> wrote in message news:20040718095842.70764.qmail@pb1.pair.com... > Hi everyone. A few quick pointers if you have time... > > I've created a session, easy enough: > <?php session_start(); ?> > > I've created variables: > $_SESSION['UserID'] = UserID; > $_SESSION['Authorised']="yes"; > $_SESSION['logname'] = $logname; > > When a user clicks a link to a test page I created the following doesn't > work though: > echo $_SESSION["UserID"]; > > Do I need to use the (again): > <?php session_start(); ?> > > ??? Confused...! > > Also - rather than list the session variables the way I am new line session, > new line session etc. is there a better way...? > > -- > ----------------------------- > Michael Mason > Arras People > www.arraspeople.co.uk > -----------------------------

« previous php.general (#190897) next »