function myGet($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, "User-Agent: Opera/9.25 (Windows NT 6.0; U; ru)"); curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); if ($result) { return $result; } else { return false; } } $image = myGet($_GET['url']); |