note 81400 added to function.file-exists
| From: | jaz-t at hotmail dot com | Date: | Tue, 26 Feb 2008 15:12:47 +0000 |
| Subject: | note 81400 added to function.file-exists | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136499@lists.php.net to get a copy of this message | ||
Note on openspecies entry (excellent btw, thanks!).
If your server cannot resolve its own DNS, use the following:
$f = preg_replace('/www\.yourserver\.(net|com)/', getenv('SERVER_ADDR'), $f);
Just before the $h = @get_headers($f); line.
Replace the extensions (net|com|...) in the regexp expression as appropriate.
EXAMPLE:
File you are checking for: http://www.youserver.net/myfile.gif
Server IP: 10.0.0.125
The preg_replace will effectively 'resolve' the address for you by assigning $f as
follows:
http://10.0.0.125/myfile.gif
----
Server IP: 69.147.83.197
Probable Submitter: 80.200.253.235
----
Manual Page -- http://www.php.net/manual/en/function.file-exists.php
Edit -- https://master.php.net/note/edit/81400
Del: integrated -- https://master.php.net/note/delete/81400/integrated
Del: useless -- https://master.php.net/note/delete/81400/useless
Del: bad code -- https://master.php.net/note/delete/81400/bad+code
Del: spam -- https://master.php.net/note/delete/81400/spam
Del: non-english -- https://master.php.net/note/delete/81400/non-english
Del: in docs -- https://master.php.net/note/delete/81400/in+docs
Del: other reasons-- https://master.php.net/note/delete/81400
Reject -- https://master.php.net/note/reject/81400
Search -- https://master.php.net/manage/user-notes.php