I want to present the user with a holding page that is replaced with the index.html page of a new website once the website has been created.
At the moment, I can only do it by having a timed refresh.
<?php
//DB connection and posting
$location="http://" . $id;
header("refresh: 240; url=$location");
?>
<?
ob_start();
?>
..... HTML code of holding page
<?
echo ob_get_clean();
?>
Slightly out of my depth with this but have tried putting the holding page code at the beginning of the code and then inserting the following code at the end to validate the index.html file. But no luck . Any help much appreciated
<?
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $location);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
start:
$retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($retcode == "200")
{
header("url=$location");
}
else
{
sleep(5);
goto start;
}
?>