怎么通过PHP得到此URL跳转后的URL
程序员文章站
2022-05-15 10:07:40
...
如何通过PHP得到此URL跳转后的URL
他是如何跳转的~~
如何通过PHP得到此URL跳转后的URL
------解决方案--------------------
HTTP/1.1 301 Moved Permanently
Server: nginx/1.0.15
Date: Thu, 17 Jan 2013 06:48:10 GMT
Content-Type: text/html
Connection: keep-alive
X-Powered-By: PHP/5.2.17
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 17 Jan 2013 06:48:10 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Location: http://s.click.taobao.com/t?e=zGU34CA7K%2BPkqB07S4%2FK0CFcRfH0G7DbPkiN9MMH7EkQ%2B3KnWlM5fPrbcF5EKeNJ3Ts8ijJ4%2F77oX8O2iw1qEuhEhgaut73j9hJ3YPtNYm616DyrkK0aE1E31WN8TefmpCriY9EJ5O4JCWiRap3Rj1hfNxI2HSqhk8lK01rAylx5%2F9fHp6i%2FPRGYAGeegVo%2F&spm=2014.12231445.1.0&u=22t7218
Content-Length: 0
HTTP/1.1 302 Moved Temporarily
Server: Tengine
Date: Thu, 17 Jan 2013 06:48:22 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: close
Location: http://s.click.taobao.com/t_js?tu=http%3A%2F%2Fs.click.taobao.com%2Ft%3Fe%3DzGU34CA7K%252BPkqB07S4%252FK0CFcRfH0G7DbPkiN9MMH7EkQ%252B3KnWlM5fPrbcF5EKeNJ3Ts8ijJ4%252F77oX8O2iw1qEuhEhgaut73j9hJ3YPtNYm616DyrkK0aE1E31WN8TefmpCriY9EJ5O4JCWiRap3Rj1hfNxI2HSqhk8lK01rAylx5%252F9fHp6i%252FPRGYAGeegVo%252F%26spm%3D2014.12231445.1.0%26u%3D22t7218%26ref%3D%26et%3DjFBB1ttOjF2GRA%253D%253D
Expires: Thu, 17 Jan 2013 06:48:22 GMT
Cache-Control: max-age=0
HTTP/1.1 200 OK
Server: Tengine
Date: Thu, 17 Jan 2013 06:48:22 GMT
Content-Type: text/html; charset=GBK
Content-Length: 2267
Last-Modified: Tue, 15 Jan 2013 01:49:17 GMT
Connection: close
Vary: Accept-Encoding
Expires: Thu, 17 Jan 2013 06:48:22 GMT
Cache-Control: max-age=0
Accept-Ranges: bytes
http://www.chong4.com.cn/cydb/go.php?7218_29882_22t
他是如何跳转的~~
如何通过PHP得到此URL跳转后的URL
------解决方案--------------------
$url = 'http://www.chong4.com.cn/cydb/go.php?7218_29882_22t';得到
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$content = curl_exec($ch);
echo $content;
HTTP/1.1 301 Moved Permanently
Server: nginx/1.0.15
Date: Thu, 17 Jan 2013 06:48:10 GMT
Content-Type: text/html
Connection: keep-alive
X-Powered-By: PHP/5.2.17
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Thu, 17 Jan 2013 06:48:10 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Location: http://s.click.taobao.com/t?e=zGU34CA7K%2BPkqB07S4%2FK0CFcRfH0G7DbPkiN9MMH7EkQ%2B3KnWlM5fPrbcF5EKeNJ3Ts8ijJ4%2F77oX8O2iw1qEuhEhgaut73j9hJ3YPtNYm616DyrkK0aE1E31WN8TefmpCriY9EJ5O4JCWiRap3Rj1hfNxI2HSqhk8lK01rAylx5%2F9fHp6i%2FPRGYAGeegVo%2F&spm=2014.12231445.1.0&u=22t7218
Content-Length: 0
HTTP/1.1 302 Moved Temporarily
Server: Tengine
Date: Thu, 17 Jan 2013 06:48:22 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: close
Location: http://s.click.taobao.com/t_js?tu=http%3A%2F%2Fs.click.taobao.com%2Ft%3Fe%3DzGU34CA7K%252BPkqB07S4%252FK0CFcRfH0G7DbPkiN9MMH7EkQ%252B3KnWlM5fPrbcF5EKeNJ3Ts8ijJ4%252F77oX8O2iw1qEuhEhgaut73j9hJ3YPtNYm616DyrkK0aE1E31WN8TefmpCriY9EJ5O4JCWiRap3Rj1hfNxI2HSqhk8lK01rAylx5%252F9fHp6i%252FPRGYAGeegVo%252F%26spm%3D2014.12231445.1.0%26u%3D22t7218%26ref%3D%26et%3DjFBB1ttOjF2GRA%253D%253D
Expires: Thu, 17 Jan 2013 06:48:22 GMT
Cache-Control: max-age=0
HTTP/1.1 200 OK
Server: Tengine
Date: Thu, 17 Jan 2013 06:48:22 GMT
Content-Type: text/html; charset=GBK
Content-Length: 2267
Last-Modified: Tue, 15 Jan 2013 01:49:17 GMT
Connection: close
Vary: Accept-Encoding
Expires: Thu, 17 Jan 2013 06:48:22 GMT
Cache-Control: max-age=0
Accept-Ranges: bytes
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
上一篇: 让PHP管理小型的邮件列表
推荐阅读
-
Codeigniter实现处理用户登录验证后的URL跳转_php实例
-
linux - 自己写的项目,如果服务器配置url重写了,那原来已经写好链接怎么办?还是 .php 啊,要进入代码一起改成重写后格式吗?
-
Codeigniter实现处理用户登录验证后的URL跳转_PHP教程
-
怎么使用PHP,获取图片跳转后的URL地址
-
PHP获取URL跳转后的链接
-
linux - 自己写的项目,如果服务器配置url重写了,那原来已经写好链接怎么办?还是 .php 啊,要进入代码一起改成重写后格式吗?
-
怎么通过PHP得到此URL跳转后的URL
-
PHP怎么通过URL访问,获得新的URL 【调用百度map】
-
PHP获取URL跳转后的链接
-
Codeigniter实现处理用户登录验证后的URL跳转_PHP