note 33214 added to function.require-once
| From: | chade at hopi dot dtcc dot edu | Date: | Thu, 19 Jun 2003 12:46:31 +0000 |
| Subject: | note 33214 added to function.require-once | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50645@lists.php.net to get a copy of this message | ||
Just a note that the $_SERVER['DOCUMENT_ROOT'] will give you the path defined in the
httpd.conf file as the document root... for instance, /var/www/html.
This is not a good idea to use if your website resides in /var/www/html/project because if
you're developing on one box and have to port it to another, you'll come across the issue
of your projects' directory changing.
The best way to handle this is to include a variable or define() in a config file that is included
in every PHP file, (along with session info perhaps) that defines a few basic things, including the
URL of the site. Then one could simply do this:
include_once("$url/project1/themes/$theme.css");
----
Manual Page -- http://www.php.net/manual/en/function.require-once.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33214
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33214&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33214&report=yes