采集$url="http://s.click.taobao.com/t_8?e=7HZ6jHSTbIWZXoQ43%2BGOC2vGvlT28S6knArdy2HkZM%2BsVw%3D%3D&p=mm_32165125_0_0";
淘宝会自动跳转url地址:http://item.taobao.com/item.htm?id=15711538808&ali_trackid=2:mm_32165125_0_0:1346999816_310_551572511怎样才能获取到跳转后的url,请帖详细代码
淘宝会自动跳转url地址:http://item.taobao.com/item.htm?id=15711538808&ali_trackid=2:mm_32165125_0_0:1346999816_310_551572511怎样才能获取到跳转后的url,请帖详细代码
解决方案 »
- 如何用javascript获取控件的值
- 请教个json解析问题
- PHP+AJAX
- 数组分页,查到数组值不符合查询条件时,怎么依次显示后边符合条件的值
- linux+apache+php,设置虚拟主机不成功请教
- 为什么是$str1 = "".$str2,而不是$str1 = $str2
- 初用php碰到又低级又头痛的问题,谁遇到过??
- ISS6+PHP5rc1+mysql5 ,,,,
- 想做一个带有扫描功能的页面,请各大老进来讨论一下吧.
- 请问如果要在Win2000下安装GD库除了修改php.ini文件之外还有什么要做?
- httpd.conf的配置问题,求高手解答!
- 非递归无限分类的,问题,请高手指点下
curl_setopt($content, CURLOPT_NOBODY,true);
curl_setopt($content,CURLOPT_TIMEOUT,3);
curl_setopt($content,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($content,CURLOPT_MAXREDIRS,20);
curl_setopt($content,CURLOPT_RETURNTRANSFER,true);
curl_setopt($content,CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.0)");
$orders=@curl_exec($content);
@curl_close($content);
curl_setopt($content,CURLOPT_URL,$rel_url);
curl_setopt($content,CURLOPT_HEADER,0);
curl_setopt($content,CURLOPT_TIMEOUT,50);
curl_setopt($content,CURLOPT_FOLLOWLOCATION,1);
curl_setopt($content,CURLOPT_MAXREDIRS,20);
curl_setopt($content,CURLOPT_RETURNTRANSFER,true);
curl_setopt($content,CURLOPT_USERAGENT,"Mozilla/4.0 (compatible;MSIE 7.0;Windows NT 5.0)");
curl_setopt($content,CURLOPT_REFERER,$rel_url);
curl_setopt($content,CURLOPT_ENCODING,"gzip");
$orders=curl_exec($content);
curl_close($content);
function get_title($url)
{
@$content=curl_init();
curl_setopt($content,CURLOPT_URL,$url);
curl_setopt($content,CURLOPT_HEADER,true);
curl_setopt($content, CURLOPT_NOBODY,false);
curl_setopt($content,CURLOPT_TIMEOUT,3);
curl_setopt($content,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($content,CURLOPT_MAXREDIRS,20);
curl_setopt($content,CURLOPT_RETURNTRANSFER,true);
curl_setopt($content,CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.0)");
$orders=@curl_exec($content);
@curl_close($content);
return $orders;
}
$e=get_title('http://www.baidu.com/');
print_r($e);
跳转后的地址还是没有得到http://item.taobao.com/item.htm?id=15711538808&ali_trackid=2:mm_32165125_0_0:1347002474_3k3_1929734884
http://s.click.taobao.com/t_8?e=7HZ6jHSTbIWZXoQ43%2BGOC2vGvlT28S6knArdy2HkZM%2BsVw%3D%3D&p=mm_32165125_0_0
$status = curl_getinfo($ch);
$status['redirect_url'] ;// 跳转到的新地址