$ch = curl_init() ;
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_URL,$url) ;
curl_setopt($ch, CURLOPT_POST,count($fields)) ;
curl_setopt($ch, CURLOPT_POSTFIELDS,$fields_string) ;
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$result = curl_exec($ch) ;
curl_close($ch) ;代码如上,在本地windows+apache测试无误,上传到服务器后就提示Object moved to here,这个是模拟一个登录,登录成功后跳转到另一个页面,Object moved to here的here的链接就是要跳转到的页面,服务器是*nix的,我估计是系统的问题,可是却找不出具体原因也不知道如何修改,望达人指教一二。
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_URL,$url) ;
curl_setopt($ch, CURLOPT_POST,count($fields)) ;
curl_setopt($ch, CURLOPT_POSTFIELDS,$fields_string) ;
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$result = curl_exec($ch) ;
curl_close($ch) ;代码如上,在本地windows+apache测试无误,上传到服务器后就提示Object moved to here,这个是模拟一个登录,登录成功后跳转到另一个页面,Object moved to here的here的链接就是要跳转到的页面,服务器是*nix的,我估计是系统的问题,可是却找不出具体原因也不知道如何修改,望达人指教一二。
解决方案 »
- 登陆成功 Warning: Cannot modify header information - headers already sent by (output
- php 判断时间大小
- XML 文档只能有一个顶层元素
- 如何只删除session中某个元素?
- 将字符串存入mysql前进行了mysql_real_escape_string,取出来的时候怎么把文本转成正常格式呢?
- 不用链接的方式 如何能让一串图片二进制数据在WAP上显示??
- 一个用户注册的问题
- 想找一个水印程序,只有读取的时候才加水印.
- PHP如果隐藏后缀名?如www.xxx.com/admin?id=50这样?
- php怎么才能上传100M以上的文件?从多方面条件找解决方法:(,上传时间就要好久:(
- itunes相关问题
- 输出图片排列
加一句代码http://curl.phptrack.com/forum/viewtopic.php?p=1294
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://www.360buy.com/product/549427.html');
curl_setopt($curl, CURLOPT_REFERER, 'http://www.360buy.com');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
curl_close($curl);
print_r($result);
?>