note 94846 added to function.file-get-contents
| From: | boris at osu1 dot php dot net | Date: | Sat, 28 Nov 2009 03:17:12 +0000 |
| Subject: | note 94846 added to function.file-get-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-163357@lists.php.net to get a copy of this message | ||
It seems that when using
$f = 'www.yourwebsite.com/some_directory/some_file.txt';
$f = file_get_contents($f,'r');
echo "\n\n$f\n\n";
the server considers the address to be an external one even that "some_file.txt" is on the
same server where the PHP file is run at
In order to go around simply replace the domain name with ".."
$f = '../some_directory/some_file.txt';
$f = file_get_contents($f,'r');
echo "\n\n$f\n\n";
----
Server IP: 69.147.83.197
Probable Submitter: 68.13.177.140
----
Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php
Edit -- https://master.php.net/note/edit/94846
Del: integrated -- https://master.php.net/note/delete/94846/integrated
Del: useless -- https://master.php.net/note/delete/94846/useless
Del: bad code -- https://master.php.net/note/delete/94846/bad+code
Del: spam -- https://master.php.net/note/delete/94846/spam
Del: non-english -- https://master.php.net/note/delete/94846/non-english
Del: in docs -- https://master.php.net/note/delete/94846/in+docs
Del: other reasons-- https://master.php.net/note/delete/94846
Reject -- https://master.php.net/note/reject/94846
Search -- https://master.php.net/manage/user-notes.php