<?php //第一种 // $url = "http://www.weisico.com"; // echo "<script language='javascript' type='text/javascript'>"; // echo "window.location.href='$url'"; // echo "</script>"; // echo $url = "testmysql.php"; // echo "<SCRIPT LANGUAGE=JavaScript>"; // echo "location.href='$url'"; // echo "</SCRIPT>"; //第二种 // $url = "http://www.weisico.com"; ?> <!--- <html> // <head> // <meta charset="utf-8"> // <meta http-equiv="X-UA-Compatible" c /> // <meta http-equiv="refresh" c echo $url; ?>"> // </head> // <body> // 页面只停留一秒…… // </body> // </html> --> //第三种 //重定向浏览器 header("Location: http://www.weisico.com"); //Location: 后面有一个空格 //确保重定向后,后续代码不会被执行 exit; ?>
Das Obige stellt verschiedene Implementierungstechniken des PHP-Seitensprungs vor, einschließlich inhaltlicher Aspekte. Ich hoffe, dass es für Freunde hilfreich ist, die sich für PHP-Tutorials interessieren.