PHP页面跳转方式

PHP 跳转

< ?php
//重定向浏览器
header("Location: http://blog.csdn.net/abandonship");
//确保重定向后后续代码不会被执行
exit;
?>

PHP + HTML 跳转

<?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 + JS 跳转

<?php
$url = "http://blog.csdn.net/abandonship";
echo "<script type='text/javascript'>";
echo "window.location.href='$url'";
echo "</script>";
?>

引入文件

<?php include 'footer.php';?>

回到顶部

Copyright © 2017-2024 1px.run (像素教程) Distributed by an MIT license.

Site updated at 2024-04-23 12:45