常用php页面跳转代码
常用php页面跳转代码
ASP页面:
<%response.redirect "页面路径"%>
有好几种方法:
(1)在页面中跳转:加入以下句子,2秒后跳到test.html
(2)2秒后转到ly2.php
(3)在php中用header()函数跳转:
(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'" /><!--这种最好-->
常用php页面跳转代码
<meta http-equiv=refresh content='1;url=index.php'>
<script>
url="submit.php?var=<?=$value?>";
window.location.href="/url";
</script>
url="submit.php?var=<?=$value?>";
window.location.href="/url";
</script>
<script>
window.open('url,'','_self');
</script>
window.open('url,'','_self');
</script>
<?
$page="index.php?bianliang=".$bianliang;
echo "<SCRIPT>window.location = \"".$page."\"; </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'" /><!--这种最好-->