# Open connection to the dhs members web server to update host
$fp = fsockopen("members.dhs.org", 80, $errno, $errstr, 30);
if($fp)
{
$postdata = "updatetype=Online&type=4&hostscmd=edit&hostscmdstage=2";
$postdata.=
"&ip=$ipaddr&mx=$mxhost&offline_url=$offlineurl&cloak=$cloak";
$postdata.=
"&cloak_title=$cloak_title&domain=$dhsdomain&hostname=$dhshostname";
$length = strlen($postdata);
$requri = "POST /nic/hosts HTTP/1.0\n";
$requri.= "Host: members.dhs.org\n";
$requri.= "Authorization: Basic
".base64_encode("$user:$pass")."\n";
$requri.= "Content-type: application/x-www-form-urlencoded\n";
$requri.= "Content-length: $length\n\n";
$requri.= "$postdata\n";
fputs($fp, $requri);
# Get the response from the dhs server.
while(!feof($fp)) $buffer.=fgets($fp,1024);
fclose($fp);
}
|