buzzme Posted August 6, 2006 Share Posted August 6, 2006 I hope some one can help . I have my web site hosted on powweb and I want a user to be redirected when they access my local image server through a link on my web site to another page on my web site when my local image server is offline . I trust this makes sense and all replies welcome .I have tried the following script but when my local server is offline it fails to redirect to a page on my website which lets the user know the server is offline .<?phpif (! $sock = @fsockopen('localserver', 80, $num, $error, 2))header("location: http://some_local_server/fif=cat.fpx&init=0.0,0.0,1.0,1.0&rect=0.46875,0.59 375,0.53125,0.65625&wid=300&hei=300&lng=en_US&enab lePastMaxZoom=OFF&page=simple/simple2.htm&obj=uv,1.0&cmd=reset");else {fclose($sock);header("location: http://www.website_hosted_on_powweb.com/local_image_server_offline_message.html");}?>P.S. It redirects to the first header okay . Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 6, 2006 Share Posted August 6, 2006 the only way to do that is have your own dns server ok. Quote Link to comment Share on other sites More sharing options...
buzzme Posted August 6, 2006 Author Share Posted August 6, 2006 Thanks for the reply but I am already using one through www.no-ip.com . I am using their free service atm but do not see a redirect function when the server is unreachable . Does anyone know a free dns service that provides this ???? Or does anyone have a work around using curl or fsockopen ???? Quote Link to comment Share on other sites More sharing options...
Prismatic Posted August 6, 2006 Share Posted August 6, 2006 run a cron job every 5 minutes or so that checks if your server is up or down. Have the script change a link in the database depending on if it's up or not, this is the link you will display. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.