有没有办法在PHP中从一个网页重定向到另一个网页? [英] Is there a way to redirect from one webpage to another in PHP?

查看:326
本文介绍了有没有办法在PHP中从一个网页重定向到另一个网页?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在PHP中从一个网页重定向到另一个网页?

解决方案

您可以使用标题功能并重定向用户。



标题( 位置:< new-page>); 





请参阅此主题以获取更多信息 [ ^ ]。


从php页面重定向到另一个页面(不只是php,你可以用这种方式重定向到任何页面),试试这个:



 <?php  

header( 位置:http: //www.example.com/some_page.php);
退出; // < - 别忘了这个!

>


Is there a way to redirect from one webpage to another in PHP?

解决方案

You can use the header function and redirect the user.

header("Location: <new-page>");



See this thread for more[^].


To redirect from a php page to another page (not just php, you can redirect to any page this way), try this:

<?php 

header("Location:http://www.example.com/some_page.php"); 
exit; // <- don't forget this!

?>


这篇关于有没有办法在PHP中从一个网页重定向到另一个网页?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆