Code:
<?php
$directory = 'http://www.google1.com';
$returntransfer = true;
$connecttimeout = 10;
$timeout = 10;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $directory);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, $returntransfer);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connecttimeout);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
$execute = curl_exec($ch);
$curl_errno = curl_errno($ch);
$curl_error = curl_error($ch);
curl_close($ch);
if ($curl_errno > 0) {
echo "cURL Error ($curl_errno): $curl_error\n";
}
?>
I want to wait 10 seconds on browser. After 10 seconds, it will show the error messages on the browser. However, when I refresh my web page, it only load 3 seconds. How should I do in order to load 10 seconds on the browser?
sleep(10);(ahah.)$directory = 'http://www.google.com';and addcurl_setopt ($ch, CURLOPT_PORT , 81);