利用curl发get请求时,url后边不能带有查询字符串吗??????为啥带上就访问不到页面呢??
回复内容: 利用curl发get请求时,url后边不能带有查询字符串吗??????为啥带上就访问不到页面呢??
对url的要求和浏览器没差。
上代码才知道你做了什么。
curl, get和post都没问题的,你的代码是不是有问题.把代码贴上来看下吧.
你是怎么用的curl,不可能不行的啊!看看你的curl_setopt是怎么设置的
//必须把$_get的信息拼接好放到url里面去 function httpget($url) { $curl = curl_init(); curl_setopt($curl, curlopt_returntransfer, true); curl_setopt($curl, curlopt_timeout, 500); curl_setopt($curl, curlopt_ssl_verifypeer, false); curl_setopt($curl, curlopt_ssl_verifyhost, false); curl_setopt($curl, curlopt_url, $url); $res = curl_exec($curl); curl_close($curl); return $res; }