Re: RE: [PHP] Help needed - need to access a value from DB into all pages

From: Date: Fri, 22 Feb 2002 00:25:05 +0000
Subject: Re: RE: [PHP] Help needed - need to access a value from DB into all pages
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-17173@lists.php.net to get a copy of this message
Sessions seems to be the popular way to go. It's stored at the server, so you don't have to worry about any clients disabling cookie support. -- William Fong - wfong@mookandblanchard.com Phone: 626.968.6424 x210 | Fax: 626.968.6877 Wireless #: 805.490.7732 | Wireless E-mail: 8054907732@mobile.att.net ----- Original Message ----- From: "Martin Towell" <martin.towell@world.net> To: "'WG4- Cook, Janet'" <JCook@ICO.NEC.COM.AU>; "PHP db list" <php-db@lists.php.net>; "PHP List" <php-general@lists.php.net> Sent: Thursday, February 21, 2002 4:06 PM Subject: [PHP-DB] RE: [PHP] Help needed - need to access a value from DB into all pages : I can think of three ways you could do this. : : 1. as a cookie : 2. using sessions : 3. put it in every link : : Martin : : -----Original Message----- : From: WG4- Cook, Janet [mailto:JCook@ICO.NEC.COM.AU] : Sent: Friday, February 22, 2002 10:59 AM : To: PHP db list; PHP List : Subject: [PHP] Help needed - need to access a value from DB into all : pages : : : Hi there, : : I am struggling with a concept and can't seem to find a way to do it so : hoping you all can help. : : We want to use PHP with MySql Db. : For security reasons on the DB, it is to be accessed only through this front : end i.e. via the internal web : Each user will have a number of levels of access to various parts of the : system, so the obvious design is one where there is only 1 real login to the : MySQL db (i.e. the system will auto log everyone in as this without them : knowing it), and then the user is validated against a table in my DB which : holds the access rights. I can get through the login OK, and get my table to : return "USERID" for this person. Now I need that "USERID" available to ALL : other pages so I can use it to determine what parts of screens to show, and : what to allow them to do. : : My question is how do I make this variable available to all pages?? Do I : have to include it with the variables passed to each page or is there a : simpler way of doing it. Can I put the variable in an include file and : include it in every page - will that work?. : : Surely someone must have had a similar situation before and can tell me how : they solved it. : : Many thanks : : Janet : : : : : -- : PHP General Mailing List (http://www.php.net/) : To unsubscribe, visit: http://www.php.net/unsub.php :

« previous php.db (#17173) next »