I want to redirect a page to another server using php. But sometimes the server goes down for maintenance as It's still in BETA.
So I would like to use a php script which can first run a curl function or code to receive a particular value from the server to ensure that the server is online. then redirect the page.
like
curl http://11.21.21.231/curl_connector_script.php
then recive the value as a string
if $string=1
run the php redirect code
else
showing in my page that server is offline
Sorry but I am very very new to php.
Can anyone tell me how can I do this in a proper php code?