Php 我没有回应
我正在使用curl从不同服务器上的文件获取响应 卷曲代码:Php 我没有回应,php,curl,Php,Curl,我正在使用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($c
$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;
}
但它没有回应
我们将不胜感激
$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';
}
此外:
您必须回显从curl返回的传输。trck.php不回显文本。也尝试了回显,但不起作用。这是怎么回事?您必须将主机从
example
更改为文件trck.php所在的位置
$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;