function redirect($url) { if ($this->in_fb_canvas()) { echo '<fb:redirect url="' . $url . '"/>'; } else { if (preg_match('/^https?:\\/\\/([^\\/]*\\.)?facebook\\.com(:\\d+)?/i', $url)) { // make sure facebook.com url's load in the full frame so that we don't // get a frame within a frame. echo "<script type=\"text/javascript\">\ntop.location.href = \"{$url}\";\n</script>"; } else { http_header('Location', $url); } } exit; }
<?php function http_header($url) { $handle = curl_init($url); curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE); $response = curl_exec($handle); $httpCode = curl_getinfo($handle, CURLINFO_HTTP_CODE); $loadtime = curl_getinfo($handle, CURLINFO_TOTAL_TIME); curl_close($handle); echo "<br/><br/>"; echo "<b>HTTP Code: </b> {$htmlcode}"; echo "<br/></br>"; echo "<b> Load Time:</b>" . $loadtime; } $webaddress = $_POST["website"]; $htmlcode = http_header($webaddress);