I am trying to write php to refresh the url redirect. The saturation is if destination page is busy, it will redirect to a url like http://www.go.com/busy.php. If it goes normal, it will go to http://www.go.com. And I want to refresh the web until it goes to the normal page.
Here is my code but I think it's wrong...
<?php
$url = "http://www.go.com/busy.html";
$url2 = "http://www.go.com/action.php";
$page = $_SERVER['PHP_SELF'];
$sec = "1";
if ($url == $url2) {
header ("http://www.go.com/action.php");
}
else {
header ("Refresh: $sec; url=$page");
}
?>