Full-service Internet Marketing & Web Development
Recent Posts

Sponsors
![]() |
HTTP ClassCode Wizard, 12-30-2006 |
Sends redirection and notifies users if site is up or down. Example included in header... (Used and Modified from Wrox Press)
<?php
//
// $http = new http;
// $fp = $http->http_sess("http://evilwalrus.com","/");
// if(!$fp) {
// print "Server not available";
// exit;
// }
// print "<BASE HREF="http://evilwalrus.com/"><p>";
// fpassthru($fp);
//
class http {
var $prooxy_host = "";
var $proxy_port = 0;
function http_sess($host,$path,$port=80) {
if(empty($this->proxy_host)) {
$conn_host = $host;
$conn_port = $port;
} else {
$conn_host = $this->proxy_host;
$conn_port = $this->proxy_port;
}
$abs_url = "http://$host:$port$path";
$query = "GET $abs_url HTTP/1.0
".
"Host: $host:$port
".
"User-agent: PHP/Class HttpSess 1.xE
".
"
";
$fp = fsockopen($conn_host,$conn_port);
if(!$fp) {
return false;
}
fputs($fp,$query);
while(trim($fp,1024)) != "");
return $fp;
}
}
?>
|
|
Subscribe Now to receive new posts via Email as soon as they come out.
Comments
Post your comments

