I run file_exists('posting.php');
It returns false.
Is it because I am testing locally, or because you can't check remote files through file_exists()?
file_exists(on someone elses website)
Moderator: General Moderators
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
The manual pretty much explains it. file_exists() uses stat() which, until PHP 5, did not support remote requests.
And the http wrapper page sayshttp://de2.php.net/file_exists wrote:As of PHP 5.0.0 this function can also be used with some URL wrappers. Refer to Appendix N, List of Supported Protocols/Wrappers for a listing of which wrappers support stat() family of functionality.
http://de2.php.net/manual/en/wrappers.http.php wrote:Supports stat() No
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Use cURL to request the headers (or get_headers()). Analyze the contents.
A return code in the 200's means the file is apparently there.
A return code in the 200's means the file is apparently there.
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm