Thank you all very much...
One last problem though: the IP address i get from the file is then used to 'include' a file from the apache webserver running on my PC.
Here is my code:
<?php
$webaddress = "http://";
$online = "/online.txt";
$content = implode('',@file('textfile.txt'));
//text file is on my webserver...
//implode as there is only 1 word, no spaces
echo ("$content<br>");
//show the IP on the page
$isonline = implode('',@file($webaddress.$content.$online));
//$webaddress.$content.$online will
//look like : [url]http://**.**.**.**/online.txt[/url]
//this file is on my home PC
echo ("$isonline<br>");
//show file contents ("online")
//print the right message
if ($isonline == "online") {
echo ("Server is online");
}else{
echo ("Server is offline");
}
?>
All works well when the the server (my PC) is running, producing:
...*
online
Server is online
However, when i close the webserver on my PC i get this:
...*
Warning: implode() [function.implode]: Bad arguments. in /home/www/webideyt/testing/phpthing.php on line 9
Server is offline
I still get this error when i remove;
echo ("$isonline<br>");
//show file contents ("online")
How can i stop the error message, and just leave the string empty, or containing the error page?
Note: ...* represents the IP address.
Thank you very much.
Dave