Home  >  Article  >  php教程  >  php中的网页重定向

php中的网页重定向

WBOY
WBOYOriginal
2016-05-25 16:51:49838browse

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

1,利用header()重定向

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

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

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

3、用嵌入javascript的重定向

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


本文地址:

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

Statement:
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
Previous article:php实现封IP功能 Next article:一段防盗链的PHP代码