探讨PHP页面自动跳转的实现方法
PHP页面自动跳转的实现对于PHP新手来说还是比较陌生的,希望通过对本文的理解,能够提高我们的实际编程能力,对PHP页面自动跳转的实现方法有一个深刻的了解。
1.meta 标签实现跳转:
<meta http-equiv="refresh" content="秒; url=下一个页面">
2 .JavaScript实现跳转:
- < script language="JavaScript">
- var userAgent = navigator.userAgent;
- var MSIEIndex = userAgent.indexOf("MSIE");
- if (userAgent.indexOf("Win") != -1 &&
- userAgent.indexOf("MSIE") != -1 &&
- userAgent.substring((MSIEIndex + 5),(MSIEIndex + 8)) >= 5.5)
- window.location.replace("http://www.shuigong.com");
- //-->
- < /script>
3 假如访问网站时,直接进入某个子目录中的文件,如cgi-bin/leoboard.cgi,这时,只要写一个默认的首页文件如index.htm,内容如下,就可以实现你的要求.
PHP页面自动跳转方法一:
< html> < head> < title>网页跳转< /title> < meta http-equiv="refresh" content="0;url=cgi-bin/leoboard.cgi"> < /head> < body> < /body> < /html>
PHP页面自动跳转方法二
<html> < head> < title>正在进入>>> Loading>>> < /title> < /head> < body bgcolor="#FFFFFF" text="#000000"> < p> < /p>< tr> <td width=724> < p align=center><font color="red" size="2"> 正在进入,请等待,谢谢......< /font>< /p>< /td>< /tr>< tr> < td width="724"> < p align=center> < form name=loading> < div align=center> < p> < input type=text name=chart size=46 tyle="font-family:Arial; font-weight: bolder; color:rgb(124,119,119); background-color:white; padding:0px; border-style:none;"> < br>< input type=text name=percent size=46 style="color:rgb(138,134,134); text-align:center; border-width:medium; border-style:none;"><script>var bar = 0 var line = "||" var amount ="||" count() function count(){ barbar= bar+2 amountamount =amount + line document.loading.chart.value=amount document.loading.percent.value=bar+"%" if (bar<99) { setTimeout("count()",10); } else { window.location = "http://www.wwwfox.net/cgi-bin/leoboard.cgi"; } }< /script> < / body> < /html>
实现PHP页面自动跳转的代码
1:
< script language="j avascript"> location.replace ("http://www.***.com") < /script>
2:
< script language="j avascript"> setTimeout(window.location= "http://www.dinmo.net",0) < /script>
3:
< script language="JavaScript" > bName = navigator.appName; if ((bName == "Netscape") || (bName == "Microsoft Internet Explorer")) window.location=http://www.dinmo.net; < /script> < FRAMESET rows=\'*\'> < FRAMESET cols=\'*\'> < FRAME SRC=\'http://www.dinmo.net\'> < noframes>
相关推荐
寻常白昼 2020-08-15
WasteLand 2020-06-13
JF0 2020-01-31
poplpsure 2020-01-21
唐宋源码清 2019-12-07
spinachcqb 2019-11-04
Nicolase 2019-10-29
ougexingfuba 2011-05-01
hebiwtc 2019-08-23
李大叔 2019-08-14
limuxia 2014-03-11
gongjiang 2013-05-01
limuxia 2013-05-01
有梦就能实现 2012-06-07
MXstudying 2019-06-30
yboker 2019-06-28