All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET中“找不到指定模块”的解决办法_[Asp.Net教程]
让你的.NET程序兼容不同版本的Dll文件_[Asp.Net教程]
delphi在系统菜单中添加菜单项实例
IIS7,会重用那些不该重用,HttpHandler_.net资料_编程技术
注册起动脚本,ASP.NET,AJAX的一项重要功能_.net资料_编程技术
Linux系统上把PHP编译进Apache静态内核_php资料_编程技术
无废话C#设计模式之五:Prototype_.net资料_编程技术
ASP.NET开发经验(5):,制作功能完善的安装程序_[Asp.Net教程]
利用C#远程存取Access数据库_.net资料_编程技术
实例:AJAX编写用户注册实例及技术小结_.net资料_编程技术
Reading number is top 10 pictures
奇趣的世界记录3
红楼梦金陵十二钗(1)
HongMenYan premiere XinLiangGong clairvoyant outfit PK YiFeiLiu1
全身蕾丝丝质美臀
Steal to eat bacon bird
9.3阅兵全景图8-航空梯队
机器人也有性生活吗?
More attractive than sora aoi2
非常漂亮的泳装美女
2012 national geographic daily picture1
Download software ranking
The hero
Eclipse 4.2.2 For Win32
Jinling thirteen stock
Boxer's Top ten classic battle10
Unix video tutorial18
The cock of the Grosvenor LTD handsome
apache-tomcat-6.0.33
Unix video tutorial5
Wild things 2
打鸟视频
归海一刀 published in(发表于) 2014/2/17 7:40:19 Edit(编辑)
PHP转到另一网页实现办法一,二,三_[PHP教程]

PHP转到另一网页实现办法一,二,三_[PHP教程]

PHP转到另一网页实现办法一,二,三_[PHP教程]

















PHP转到另一网页实现办法一、header()函数

header()函数是PHP中进行页面跳转的一种十分简单的方法。header()函数的主要功能是将HTTP协议标头(header)输出到浏览器。

header()函数的定义如下:

void header (string string [,bool replace [,int http_response_code]])

可选参数replace指明是替换前一条类似标头还是添加一条相同类型的标头,默认为替换。

第二个可选参数http_response_code强制将HTTP相应代码设为指定值。 header函数中Location类型的标头是一种特殊的header调用,常用来实现页面跳转。注意:1.location和“:”号间不能有空格,否则不会跳转。

2.在用header前不能有任何的输出。

3.header后的PHP代码还会被执行。例如

< ?php
//重定向浏览器
header("Location: http://www.code-123.com");
//确保重定向后,后续代码不会被执行
exit;
?>
< ?php
//重定向浏览器
header("Location: http://www.code-123.com");
//确保重定向后,后续代码不会被执行
exit;
?>

PHP转到另一网页实现办法二、Meta标签

Meta标签是HTML中负责提供文档元信息的标签,在PHP程序中使用该标签,也可以实现页面跳转。若定义http-equiv为refresh,则打开该页面时将根据content规定的值在一定时间内跳转到相应页面。若设置content="秒数;url=网址",则定义了经过多长时间后页面跳转到指定的网址。

< meta http-equiv="refresh" content="1;url=http://www.code-123.com">

例,以下程序meta.php实现在该页面中停留一秒后页面自动跳转。

$url = "http://www.code-123.com";
?>





It’s transit station.


$url = "http://www.code-123.com";
?>





It’s transit station.



PHP转到另一网页实现办法三、JavaScript
$url = "http://www.code-123.com";
echo "";
?>
$url = "http://www.code-123.com";
echo "";
?>




























添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.