Jump to content

Checking Existance Of A Localhost File?


poddys

Recommended Posts

I want to be able to check if a local copy of a website exists on a pc, and thought I might be able to do this by checking for the existance of a file on localhost.

 

I tried this using both localhost and 127.0.0.1 but it does not find the file I told it to look for.

 

Is it possible, or am I missing something?

Thanks

 

$offline_locn = "http://localhost/QAOfflineVersion.txt";

if( file_exists('$offline_locn'))

{

$offline_system = "Y";

echo('Offline System Installed $offline_locn');

}

else

{

$offline_system = "N";

echo("Offline System Not-Installed $offline_locn");

}

Link to comment
https://forums.phpfreaks.com/topic/208680-checking-existance-of-a-localhost-file/
Share on other sites

I tried changing the quotes but it made no difference.

 

I am assuming that if the test is being run on a remote server (in this case our iSeries), that I can refer to localhost ok, to link to the system on the pc?

 

Just about to head home for the weekend.  Will pick this up Monday morning.

 

Really appreciate the help :)

Tony

 

PS: Have a great weekend.

No. Localhost refers only to the machine on which the script is being executed. Could you describe what you're trying to do with a little more detail? Are you attempting to make a failover, or hot online standby, type of thing?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.