note 94846 deleted from function.file-get-contents by danbrown

From: Date: Mon, 30 Nov 2009 13:08:26 +0000
Subject: note 94846 deleted from function.file-get-contents by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-163416@lists.php.net to get a copy of this message
Note Submitter: boris ---- It seems that when using <?php $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 ".." <?php $f = '../some_directory/some_file.txt'; $f = file_get_contents($f,'r'); echo "\n\n$f\n\n"; ?>

« previous php.notes (#163416) next »