页面跳转代码集合 晴

jed , 2006-11-3 10:49 , 代码编程 , 评论(0) , 阅读(4494) , Via 本站原创 | |
常用php页面跳转代码

常用php页面跳转代码

<meta http-equiv=refresh content='1;url=index.php'>


<script>
url="submit.php?var=<?=$value?>";
window.location.href="/url";
</script>


<script>
window.open('url,'','_self');
</script>


<?
$page="index.php?bianliang=".$bianliang;
echo "<SCRIPT>window.location = \"".$page."\"; </SCRIPT>";
?>



<meta http-equiv=refresh content="1;url=index.php?aaa=<? echo $aaa ?>">



ASP页面:
<%response.redirect "页面路径"%>

有好几种方法:
(1)在页面中跳转:加入以下句子,2秒后跳到test.html
 
<meta HTTP-EQUIV=REFRESH CONTENT='2; URL=test.html'>  

(2)2秒后转到ly2.php
 
<script>setTimeout("location.href="/home/ly2.php'",2000)</script>

(3)在php中用header()函数跳转:
 
header("Location :http://www.xxx.com");

(4)用一个按钮,点击后跳转:(5种按钮)
 


<input type=button value=Return onClick

="javascript:location.href('URL');">
  <input type=button value=Return onClick=

"javascript:window.location.href('URL');">
  <input type=button value=Return onClick

="javascript:window.location.replace('URL');">
  <input type=button value=Return onClick

="javascript:window.location.assign('URL');">
  <input type="button" value="Return" onClick

="window.location='URL'" /><!--这种最好-->



发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]