温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

PHP中怎么实现页面自动跳转

发布时间:2021-08-07 11:17:40 来源:亿速云 阅读:176 作者:Leah 栏目:编程语言

这篇文章将为大家详细讲解有关PHP中怎么实现页面自动跳转,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。

1.meta 标签实现跳转:

<meta http-equiv="refresh" content="秒; url=下一个页面">

2 .JavaScript实现跳转:

  1. < script language="JavaScript">


  2. var userAgent = navigator.userAgent;

  3. var MSIEIndex = userAgent.indexOf("MSIE");

  4. if (userAgent.indexOf("Win") != -1 &&

  5. userAgent.indexOf("MSIE") != -1 &&

  6. userAgent.substring((MSIEIndex + 5),(MSIEIndex + 8)) >= 5.5)

  7. window.location.replace("http://www.shuigong.com");

  8. //-->

  9. < /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页面自动跳转方法二

  1. <html>

  2. < head>

  3. < title>正在进入>>> Loading>>> < /title>

  4. < /head>

  5. < body bgcolor="#FFFFFF" text="#000000">

  6. < p> < /p>< tr> <td width=724>

  7. < p align=center><font color="red" size="2">
    正在进入,请等待,谢谢......< /font>< /p>< /td>< /tr>< tr>

  8. < td width="724">

  9. < p align=center>

  10. < form name=loading>

  11. < div align=center>

  12. < p>

  13. < 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;">

  14. < 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

  15. var line = "||"

  16. var amount ="||"

  17. count()  

  18. function count(){  

  19. barbar= bar+2  

  20. amountamount =amount + line  

  21. document.loading.chart.value=amount

  22. document.loading.percent.value=bar+"%"  

  23. if (bar<99)  

  24. { setTimeout("count()",10); }  

  25. else  

  26. { window.location = "http://www.wwwfox.net/cgi-bin/leoboard.cgi"; }  

  27. }< /script>

  28. < / body>

  29. < /html>

实现PHP页面自动跳转的代码

1:

  1. < script language="j avascript">

  2. location.replace
    ("http://www.***.com")  

  3. < /script>

2:

  1. < script language="j avascript">

  2. setTimeout(window.location=
    "http://www.dinmo.net",0)  

  3. < /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>

JS实现跳转代码_多域名指向同一空间

< script>try { if( self.location == "http://玉米一/" ) {  top.location.href = "http://玉米一/目录";  }  else if( self.location == "http://玉米二/" ) {  top.location.href = "http://玉米二/目录";  }  else if( self.location == "http://玉米三/" ) {  top.location.href = "http://玉米三/目录";  }  else if( self.location == "http://玉米四/" ) {  top.location.href = "http://玉米四/目录";  }  else { document.write ("错误的访问地址") } } catch(e) { }  < /script>

关于PHP中怎么实现页面自动跳转就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

php
AI