方法1: PHP中 header() 函数
<ol class="linenums"> <li class="L0" value="1"> <?php <li class="L1">header("Location:http://www.php.cn");<li class="L2"> ?>
注意:
1. location 与 : 之间不能有空格,否则不会跳转。
2. header()前不能有任何的输出。
3. header()之后的PHP代码还会被执行。
方法2: Meta标签
Meta标签是HTML中负责提供文档元信息的标签,在PHP程序中使用该标签,也可以实现页面跳转。 若定义http-equiv为refresh,则打开该页面时将根据content规定的值在一定时间内跳转到相应页面。若设置content=”秒数;url=网址”,则定义了经过多长时间后页面跳转到指定的网址。
<ol class="linenums"> <li class="L0" value="1"> <html><li class="L1"> <head> <li class="L2"> <meta http-equiv="refresh" content="1;url= <li class="L3"> <title>HTML标题</title> <li class="L4"> </head> <li class="L5"> <content> <li class="L6">PHP中文网欢迎大家光临!<li class="L7"></content> </html>
方法3: javascript实现
<ol class="linenums"> <li class="L0" value="1"> <script language="javascript" type="text/javascript"> <li class="L1">location.href = "http://www.php.cn";<li class="L2"> </script>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

WebStorm Mac version
Useful JavaScript development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.
