note 69049 added to function.chdir
| From: | andy dot clark at dial dot pipex dot com | Date: | Mon, 21 Aug 2006 15:10:14 +0000 |
| Subject: | note 69049 added to function.chdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-116125@lists.php.net to get a copy of this message | ||
This only changes the directory for PHP, the output directory stays the same. If you are trying to
access images from a relative path and you use the following then it will fail to render the image:
chdir ('images');
if (file_exists('php.gif'))
{
echo '<html>';
echo '<body>';
echo '<img src="php.gif">';
echo '</body></html>';
}
//However, it is possible to use the <base> tag in the header to change the directory for the
resulting HTML, as you can see however this requires you to put the full path in place.
chdir ('images');
if (file_exists('php.gif'))
{
echo '<html>';
echo '<head><base href = "http://uk.php.net/images/"></head>';
echo '<body>';
echo '<img src="php.gif">';
echo '</body></html>';
}
----
Server IP: 85.116.0.130
Probable Submitter: 212.125.73.242
----
X-Spam-Status: Yes, hits=5.9 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_20_30,HTML_IMAGE_ONLY_04,HTML_MESSAGE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.chdir.php
Edit -- https://master.php.net/note/edit/69049
Del: integrated -- https://master.php.net/note/delete/69049/integrated
Del: useless -- https://master.php.net/note/delete/69049/useless
Del: bad code -- https://master.php.net/note/delete/69049/bad+code
Del: spam -- https://master.php.net/note/delete/69049/spam
Del: non-english -- https://master.php.net/note/delete/69049/non-english
Del: in docs -- https://master.php.net/note/delete/69049/in+docs
Del: other reasons-- https://master.php.net/note/delete/69049
Reject -- https://master.php.net/note/reject/69049
Search -- https://master.php.net/manage/user-notes.php