Site icon 时鹏亮的Blog

PHP-页面跳转

请知悉:本文最近一次更新为 12年 前,文中内容可能已经过时。

跳转一、header()函数:

<?php
//重定向浏览器
header("Location: url");
//确保重定向后,后续代码不会被执行
exit;

跳转二、Meta标签:

<meta http-equiv="refresh" content="1;url=http://url">

其中content后的数值表示秒延时

跳转三、JavaScript:

<?php
$url = "http://url";
echo "<script language='JavaScript' type='text/JavaScript'>";
echo "window.location.href='$url'";
echo "</script>";

如您从本文得到了有价值的信息或帮助,请考虑扫描文末二维码捐赠和鼓励。

尊重他人劳动成果。转载请务必附上原文链接,我将感激不尽。


与《PHP-页面跳转》相关的博文:

Exit mobile version