user = $username; $this->pass = $password; $this->ip = $this->get_ip(); } function get_ip($hostname=NULL) { if($hostname == NULL) { $file = file('http://dynamic.zoneedit.com/checkip.html'); $tmpAry = explode(':', $file[4]); return( substr($tmpAry[1], 1, (strlen($tmpAry[1])-1)) ); } else return( gethostbyname($hostname) ); } function update_ip($name, $newIP=NULL) { if($newIP == NULL) $newIP = $this->ip; $buf = ""; $host = "dynamic.zoneedit.com"; $path = "/auth/dynamic.html"; $auth = base64_encode($this->user . ":" . $this->pass); $data = "host=$name&dnsto=$newIP"; if( $fp = fsockopen($host, 80) ) { fputs($fp, "POST $path HTTP/1.1\r\n"); fputs($fp, "Authorization: Basic $auth\r\n"); fputs($fp, "Host: $host\r\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); fputs($fp, "Content-length: " . strlen($data) . "\r\n"); fputs($fp, "Connection: close\r\n\r\n"); fputs($fp, $data); while( !feof($fp) ) $buf .= fgets($fp, 128); fclose($fp); if( strpos($buf, '