个人维修技术总结

  • 首页
  • 留言本
  • 网址导航1
  • 网址导航2
情绪21℃'s Blog
众里寻他千百度。蓦然回首,那人却在,灯火阑珊处。
  1. 首页
  2. 计算机
  3. 技术文摘
  4. 正文

怎样让php页面自动跳转

2010年1月5日 8781点热度 0人点赞 0条评论
内容提示:文中举给出了几种不同形式实现页面跳转功能,实例之间实现方式多有不同,尤其是SEO跳转方法大家要注意其工作原理,SEO讲求的是对搜索引擎友好。
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,内容如下,就可以实现你的要求.

方法一:

 <html>
<head>
<title>网页跳转</title>
<meta http-equiv="refresh" content="0;url=cgi-bin/leoboard.cgi">
</head>
<body>
</body>
</html>

方法二

 <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 style="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(){
bar= bar+2
amount =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>

SEO跳转代码

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> 

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
最后更新:2013年11月1日

情绪21℃

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

取消回复
分类
  • Android
  • CID3681
  • Debian
  • Linux
  • OFFICE
  • 影音视听
  • 手机平板
  • 手机生活
  • 技术文摘
  • 文学哲理
  • 未分类
  • 机顶盒
  • 杂七杂八
  • 站长日记
  • 网站纪事
  • 计算机
  • 资源共享
  • 路由器

COPYRIGHT © 2022 情绪21℃'s Blog. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

浙ICP备11017358号-1