note 17701 added to function.include
| From: | jos_krause at hetnet dot nl | Date: | Thu, 20 Dec 2001 12:00:12 +0000 |
| Subject: | note 17701 added to function.include | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-23354@lists.php.net to get a copy of this message | ||
Me beeing a n00b in PHP I tried a totally different approach. Beeing an ASP developer to I am used
to be able to use relative paths when using include so I began to device a method of beeing able to
use this kind of including. Allthough many of the methods mentioned above would suit most users my
way of doing would be:
$web_root = substr($PATH_TRANSLATED,0,strrpos($PATH_TRANSLATED,"\\"));
This will get your root directory for the current website/project then you can simply add the
relative path to it by using:
<? include($web_root . "\includes\functions.php"); ?>
--
http://www.php.net/manual/en/function.include.php
http://master.php.net/manage/user-notes.php?action=edit+17701
http://master.php.net/manage/user-notes.php?action=delete+17701
http://master.php.net/manage/user-notes.php?action=reject+17701