разные ответы от браузера и курла

Discussion in 'PHP' started by moose, 23 Jun 2011.

  1. moose

    moose New Member

    Joined:
    13 Jun 2011
    Messages:
    0
    Likes Received:
    0
    Reputations:
    0
    проблема! браузер и курл дают разный ответ.

    захожу браузером на урл http://5yen-aru.com/product.php?id=351+and+1=0+ Union Select 1
    вижу сообщение об ошибке на паге: Warning: mysql_fetch_object(): supplied argument is not a valid
    получаю пагу курлом- вижу все то же самое, кроме сообщения об ошибке!

    код php
    PHP:
    $agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru-RU; rv:1.7.12) Gecko/20050919 Firefox/1.0.7'; 
    $header[] = "Accept: text/html;q=0.9, text/plain;q=0.8, image/png, */*;q=0.5" ; 
    $header[] = "Accept_charset: windows-1251, utf-8, utf-16;q=0.6, *;q=0.1"; 
    $header[] = "Accept_encoding: identity"; 
    $header[] = "Accept_language: en-us,en;q=0.5"; 
    $header[] = "Connection: close"; 
    $header[] = "Cache-Control: no-store, no-cache, must-revalidate"; 
    $header[] = "Keep_alive: 300"; 
    $header[] = "Expires: Thu, 01 Jan 1970 00:00:01 GMT"; 
    @
    unlink('cookie.txt');

    $ch = curl_init(); 
    curl_setopt ( $ch , CURLOPT_USERAGENT , $agent); 
    curl_setopt ( $ch , CURLOPT_HTTPHEADER , $header); 
    curl_setopt($ch, CURLOPT_URL, $url); 
    curl_setopt ( $ch , CURLOPT_REFERER ,  $url); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); 
    curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
    curl_setopt($ch, CURLOPT_TIMEOUT, 10); 
    echo 
    $result=curl_exec ($ch);