php 頁面自動跳轉
2017/06/19 23:02
瀏覽461
迴響0
推薦0
引用0
PHP頁面跳轉一、header()函數
< ?php
//重定向瀏覽器
header("Location: http://blog.csdn.net/abandonship");
//確保重定向後,後續代碼不會被執行
exit;
?>
PHP頁面跳轉二、Meta標簽
<?php
$url = "http://blog.csdn.net/abandonship";
?>
<html>
<head>
<meta http-equiv="refresh" content="1;url=<?php echo $url; ?>">
</head>
<body>
It's transit station.
</body>
</html>
PHP頁面跳轉三、JavaScript
<?php
$url = "http://blog.csdn.net/abandonship";
echo "<script type='text/javascript'>";
echo "window.location.href='$url'";
echo "</script>";
?>

