Php 卷曲url onclick按钮
我试图将代码中的url卷曲到一个页面,但是卷曲不起作用,我已经通过Php 卷曲url onclick按钮,php,curl,Php,Curl,我试图将代码中的url卷曲到一个页面,但是卷曲不起作用,我已经通过 $url="http://merimobiles.com/cart.php?action=add&product_id=9949" echo file_get_contents($url); 它给出了未找到的错误, curl代码在这里 $ch = @curl_init(); @curl_setopt($ch, CURLOPT_URL, $url); @curl_setopt($ch, CURLOPT_RETURNTR
$url="http://merimobiles.com/cart.php?action=add&product_id=9949"
echo file_get_contents($url);
它给出了未找到的错误,
curl代码在这里
$ch = @curl_init();
@curl_setopt($ch, CURLOPT_URL, $url);
@curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_REFERER,$url);
$response = @curl_exec($ch);
@curl_close($ch);
echo $response;
从curl_init、curl_setopt、curl_exec中删除@并检查错误:
$response = curl_exec($ch);
if ($response === false) {
echo 'Curl error: ' . curl_error($ch);
}
我在这个网址上看到了什么
http://merimobiles.com/cart.php?action=add&product_id=9949
被重定向到
http://www.merimobiles.com/cart.php?suggest=51444ec01e7a2
您应该设置curl选项
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
它显示echo part Curl错误:但不返回任何错误它将其带到页面,但在该页面上显示了一个错误。在该服务器上找不到请求的URL/templates/_custom/lib/shipping_schedule/shipping-1-text.html。是的,原因是它是iframe。在本例中,我将解析文档并添加
http://www.merimobiles.com
在/templates/\uu custom/lib/shipping\u schedule/shipping-1-text.html之前