文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>用Header函数实现类似ASP的Response.Redirect功能

用Header函数实现类似ASP的Response.Redirect功能

时间:2007-02-17  来源:PHP爱好者

用Header函数实现类似ASP的Response.Redirect功能
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8

chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
关键词:PHP
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8

chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
本技巧告诉大家如何用Header函数实现类似ASP的Response.Redirect功能,虽然很简单,但还是值得一看的哦.
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
if(isset($url)){
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
/*
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
请注意,这样的语句是无效的:
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
header("Location :$url");
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
header("Location : $url");
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
这样写是可以的:
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
header("Location:$url");
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
header("Location: $url");
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
也就是说在Location和冒号之间不能有空格,我试了半个小时才试出来哦,
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
希望您不要再犯这个错误了哦,^_^
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
*/
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
header("Location:$url");
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
}
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
else{
chinaitpower.com9qzrTPwEua9WMWnhyaAxBDfb8
?>
php爱好者站 http://www.phpfans.net 为phper提供一切资讯.
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载