dongyanfeng0563 2017-07-17 02:06
浏览 29
已采纳

如何在PHP中自动重定向链接[重复]

This question already has an answer here:

I have a php form for users to create an account. When the submit button is pressed, the page is redirected to a response page that saves the information to a database. I have a link on the response page that sends the user to a page which displays the account information.

echo "<a href ='AccountInformation.php'>Account Information</a>";

How can I instead make the response page automatically redirect to the display page?

</div>
  • 写回答

1条回答 默认 最新

  • duanqi6007 2017-07-17 02:07
    关注

    Easy, you make :

    header("location:AccountInformation.php");
    

    before any output (echo, print, print_r, plain HTML ... ) is sent to the web browser.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 nginx的使用与作用
  • ¥100 关于#VijeoCitect#的问题,如何解决?(标签-ar|关键词-数据类型)
  • ¥15 一个矿井排水监控系统的plc梯形图,求各程序段都是什么意思
  • ¥15 ensp路由器启动不了一直报#
  • ¥50 安卓10如何在没有root权限的情况下设置开机自动启动指定app?
  • ¥15 ats2837 spi2从机的代码
  • ¥200 wsl2 vllm qwen1.5部署问题
  • ¥100 有偿求数字经济对经贸的影响机制的一个数学模型,弄不出来已经快要碎掉了
  • ¥15 数学建模数学建模需要
  • ¥15 已知许多点位,想通过高斯分布来随机选择固定数量的点位怎么改