2013-10-11 27 views
0

我使用curl得到的迴應來自不同服務器上的文件備份..捲髮不給予任何迴應回

捲曲代碼:

$url="http://example.com/trck.php?adrs=yy"; 
$ch = curl_init($url); 

curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
$result = curl_exec($ch); 

curl_close($ch); 
return $result; 

trck.php代碼:

$url=mysqli_real_escape_string($link,$_GET['adrs']); 
$sql="SELECT * FROM product where site = '$url'"; 
$res=mysqli_query($link,$sql) or die(mysqli_error()); 
$row=mysqli_fetch_assoc($res); 
if(mysqli_num_rows($res)==0 || $row['status']==0) 
{ 
return no; 

} 
else 
{ 
return yes; 
} 

,但沒有響應形式。

幫助將不勝感激。

+0

trck.php不會回顯文本。 – tCode

+0

也嘗試回聲但不工作。 – user2466317

回答

0
$url=mysqli_real_escape_string($link,$_GET['adrs']); 
$sql="SELECT * FROM product where site = '$url'"; 
$res=mysqli_query($link,$sql) or die(mysqli_error()); 
$row=mysqli_fetch_assoc($res); 
if(mysqli_num_rows($res)==0 || $row['status']==0) 
{ 
echo 'no'; 
} 
else 
{ 
echo 'yes'; 
} 

也:

$url="http://example.com/trck.php?adrs=yy"; 
$ch = curl_init($url); 

curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
$result = curl_exec($ch); 

curl_close($ch); 
echo $result; 

你必須回波捲曲返回的轉移。

+0

來自它的意外反應[鏈接](http://awesomescreenshot.com/01e1tialfd) – user2466317

+0

這是怎麼回事?你必須將主機從「示例」更改爲無論文件trck.php託管在哪裏 – DarkBee

+0

哦..感謝我忘了更改網址:) – user2466317