note 33214 deleted from function.require-once by sniper

From: Date: Tue, 04 Nov 2003 00:45:30 +0000
Subject: note 33214 deleted from function.require-once by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-59822@lists.php.net to get a copy of this message
Note Submitter: chade@hopi.dtcc.edu ---- 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");

« previous php.notes (#59822) next »