клиент на php для tjat.com

Discussion in 'PHP' started by Student :), 27 Oct 2007.

  1. Student :)

    Student :) Elder - Старейшина

    Joined:
    9 Feb 2007
    Messages:
    278
    Likes Received:
    18
    Reputations:
    -15
    пишу клиент но не фига не выходит помогите,
     
    #1 Student :), 27 Oct 2007
    Last edited: 27 Oct 2007
  2. Sn@k3

    Sn@k3 Elder - Старейшина

    Joined:
    13 Apr 2006
    Messages:
    1,000
    Likes Received:
    437
    Reputations:
    90
    что именно не входит =\ уточни именно)
     
  3. Student :)

    Student :) Elder - Старейшина

    Joined:
    9 Feb 2007
    Messages:
    278
    Likes Received:
    18
    Reputations:
    -15
    там при заходе на главную страницу идёт перенаправление методом location
     
  4. Student :)

    Student :) Elder - Старейшина

    Joined:
    9 Feb 2007
    Messages:
    278
    Likes Received:
    18
    Reputations:
    -15
    делаю так
    PHP:
    function Curl($url,$cookies,$proxy,$ris,$telo) { 
    $ch curl_init();
    // установка URL и других необходимых параметров
    curl_setopt($chCURLOPT_URL$url);
    curl_setopt($chCURLOPT_PROXY$proxy); 
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);
    if (
    $telo=='1') {curl_setopt($chCURLOPT_NOBODY1);} //вывод без тела
    //else { curl_setopt($ch, CURLOPT_NOBODY, 0);} // вывод  тела
    if ($ris=='1') { curl_setopt($chCURLOPT_HEADER0);} // вывод без заголовков
    else { curl_setopt($chCURLOPT_HEADER1);} // вывод с заголовками
    curl_setopt($chCURLOPT_FOLLOWLOCATION1);// allow redirects  
    curl_setopt($chCURLOPT_COOKIE$cookies);
    curl_setopt($chCURLOPT_RETURNTRANSFER1); 
    $result curl_exec($ch); 
    curl_close($ch); 
    if (
    strlen($result)<3)
    return 
    false
    return 
    $result;
     }  
    ///////////////////////////// Распознаём
    $body Curl("wap.tjat.com","",$proxy,"0","0"); 

    preg_match("|Location: ([:\/\/0-9A-Za-z.\/]+)|i",$body,$loc);
    echo 
    $loc[1];
    $body1 Curl($loc[1],"",$proxy,"0","0"); 
    echo 
    $body1;
    а в ответ
    HTTP Status 500 -
     
    #4 Student :), 27 Oct 2007
    Last edited: 27 Oct 2007