I tried the functions file_get_contents and curl - it does not work with the adidas.ru site.
Previously, everything worked fine through cURL, but now it does not work. Did they block my IP?
function curl($url, $postdata) { $uagent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, $uagent); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt($ch, CURLOPT_REFERER, ""); curl_setopt($ch, CURLOPT_HEADER, 1); $content = curl_exec( $ch ); curl_close( $ch ); return $content; } echo curl('http://www.adidas.ru/search','q='); Before this, the code worked for half a year without problems. If instead of adidas write reebok, everything works.
Indeed HTTP / 1.0 403 Forbidden Error But why? If you go through the browser, it opens without problems. How can I get the page code?
HTTP/1.0 403 Forbiddendoesn't say anything? - Roman Grinyov