Forum Moderators: coopster
<?php
$url = "http://www.mysite.com";
if(server_status($url) == true){
header('location : $url');
}
else{
echo "Server down -- TRY AGAIN LATER";
}
?>
I was looking at php.net and i found Memcache::getStats(), but i don't know what that does...
Is there a way to do this?
thanks,
electricocean
<?php
$data = include('http://myname.my.isp.net/bummer.txt');
if ($data){
$url="http://myname.my.isp.net/";
}else{
$url="http://local.web.storage.area.net/";
}
?>
The file bummer.txt is just an empty file on my isp's web storage area.
I did this because at the time I had limited bandwidth available for my own server and figured that my isp could serve the images faster than my wimpy DSL connection.
This has worked extremely well for me.
<?php
$url = "http://www.mysite.com/index.php";
if(is_readable($url) && file_exists($url)){
echo "<script language=\"javascript\">
top.location.replace = \"{$url}\";
</script>";
}
else{
echo "Server down -- TRY AGAIN LATER";
}
?>
this always return fals eand outputs "Server down -- TRY AGAIN LATER".
What's wrong?