2016-09-19 60 views
0

我的捲髮不會在服務器端返回正文。我該如何糾正這一點?帖子正文沒有收到

curl_setopt($ch, CURLOPT_URL,$cpUrl);// "ex:www.lalala/aa/" 
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $varpost); // has string parameter 
curl_setopt($ch,CURLOPT_HTTPHEADER,array('VariableParams:'.$varpost)); 
info ("variables passed:",$varpost); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0); 
curl_setopt($ch, CURLOPT_NOBODY, false); 
$output = curl_exec ($ch); // Execute 

回答

0

可能發生的情況是,服務器將請求重定向到另一個url。例如,根據位置,某些網站會將其重定向到特定位置。這就是爲什麼你沒有得到任何機構,因爲你正在禁用後續的位置選項。

嘗試啓用它。

curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);