本帖最后由 guduxie 于 2013-08-19 16:42:10 编辑

解决方案 »

  1.   

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,'http://api.ajaxsns.com/api.php?key=free&appid=0&msg='.rawurlencode('我是谁').'?');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie.txt");//对方网站设置了cookies
    curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie.txt");//这2个选项是关键
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); 
    $htmls = curl_exec($ch);
    curl_close($ch);
    echo $htmls;