I need to find out if a specific file, on another host, is reachable on the local network (of the client)
This is what I would like to do
<?php
function isFileReachable(){
$urlHome = 'http://192.168.2.2/FileFolder/File.txt';
list($status) = get_headers($urlHome);
if (strpos($status, '404') !== FALSE) {
return false;
}else if(strpos($status, '200') !== FALSE){
return true;
}
}
?>
I call this script when pressing a button a my website. but I always get HTTP/1.1 301 Moved Permanently
What does this mean?
Is it possible to even do this? ifso, how do I do this? What am I doing wrong? Or are there better ways to do this?