You are here: best practice global variables « PHP Programming Language « IT news, forums, messages
best practice global variables

Posted by Marc E on 01/14/07 23:45

All,
I'm coming from java and coldfusion, where one can set a "global" variable
in one place (the servletcontext in java, Application.cfm in coldfusion) and
all files in that site can then take advantage of these variables without
the need to "include" a variables page in every page on the site.
Is there something comparable in php, like an Application.php or some such
thing?

One more question that's basically an extension of the first. in
development, my site is http://localhost/mysite, but in the hosting
environment, it's http://mysite

Now, let's say I have a "header" include that includes images in it, and
that header is included in multiple directory trees, so relative pathing of
those images isn't possible. Is there a preferred way in php for dealing
with this kind of thing, since i can't simply use /images/myimage.jpg since
that path isn't valid in the local environment?

Thanks for any answers. I'm doing some emergency work on a php site as a
favor to a friend and am quite out of my element.

Marc

 

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

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