You are here: Re: creating a session variable on every page « PHP Programming Language « IT news, forums, messages
Re: creating a session variable on every page

Posted by Ivan Marsh on 05/23/07 22:13

On Wed, 23 May 2007 14:43:24 -0700, laredotornado@zipmail.com wrote:

> Hi,
>
> I'm using PHP 4.4.4 with Apache 2.2. What I want is that if a customer
> visits any page of the top level directory of my site with this string
> passed in the URL's query string, "RID=xxx", I would like a session
> variable called "RID" with the value "xxx" to be created. However, I
> would like to avoid putting this code
>
> session_start();
> if (!empty($_REQUEST['RID'])) {
> $_SESSION['RID'] = trim(strtoupper($_REQUEST['RID']));
> } // if
>
> on every page in my top level directory. Does anyone know a more
> efficient way?
>
> Thanks, - Dave

Read up on require_once.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация