[PLUG] PHP style question

Brent Rieck bsr at spek.org
Tue Jun 24 08:47:02 UTC 2003


If you're trying to make the choice between $_SERVER and $_SESSION I'd
choose $_SERVER, unless it's set on a per-session basis, then I'd use
$_SESSION.  Were it me though I'd define a constant with the application
root it it which to me 'feels' less cumbersome than interacting with
$_SERVER.

my 0.02,
Brent

On Mon, 2003-06-23 at 15:39, Daniel B. Herrington wrote:
> All,
> 
> I have a question about $_SERVER and $_SESSION in php 4.3. I am going to set the
> application root directory in one of the superglobals. It seems to me it should
> be in the $_SERVER because its specific to the application, although on the php
> website it says these array  vars are set by the webserver.  The $_SESSION array
> seems more for vars that are specific to the use'rs session, like user name,
> home dirs, assigned groups, etc.
> 
> I was wondering what sort of rule others used for determing what to set in where.
> 
> thanks,
> Dan H.





More information about the PLUG mailing list