Home > php教程 > php手册 > body text

php中的网页重定向

WBOY
Release: 2016-05-25 16:51:49
Original
841 people have browsed it

在php中进行网页重定向一共有三种方法:

1,利用header()重定向

<?php
header("Location: $url"); 
exit; 
?>
Copy after login

2。用嵌入HTML的标识重定向

<META HTTP-EQUIV="REFRESH" CONTENT="5; URL=<?php echo $url;?>>
Copy after login

3、用嵌入javascript的重定向

<?php
echo "<!--<SCRIPT LANGUAGE=\"JavaScript\">";  
echo "location.href=&#39;$url&#39;";  
echo "</SCRIPT>-->";  
?>
Copy after login


本文地址:

转载随意,但请附上文章地址:-)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template