更新:我現在能夠訪問主網頁,但我沒有登錄PHP的捲曲登錄問題(空白頁)
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.xxx.com/?cmd=home');
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, '[email protected]&persist=on&pswd=qweqwe&from=/?cmd=home');
curl_setopt ($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec ($ch);
curl_close ($ch);
echo $content;
你不只是發表您的用戶名和密碼,是嗎? – 2011-03-11 19:23:21
是的,但它的帳戶我不使用 – jennifer 2011-03-11 19:32:19
您可能需要添加'curl_setopt($ ch,CURLOPT_FOLLOWLOCATION,true);'如果他們的登錄系統使用重定向。 – drudge 2011-03-11 19:34:00