Reply to Re: custom server variables

Your name:

Reply:


Posted by Justin Koivisto on 12/27/05 20:22

rithish@gmail.com wrote:
> Is it possible to set a custom server variable so that it may be used
> in the latter part of a script? Say something like $_SERVER["myvar"] =
> "myvalue", and then be able to use 'myvar' later.

Yes, you can do that, however once the script ends, the variable is
gone. If you want to do it across requests you'll need to use sessions
or some other storage method (database, files, etc.)

If you want to set a server "variable" it acts more like a constant. For
instance, if you use Apache and have done something like:

SetEnv apache_var1=34

Then in (all) your php scripts, $_SERVER['apache_var1'] == 34

You cannot do something like $_SERVER['apache_var1'] = 63 and have the
next request produce that value...

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

[Back to original 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

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