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

如何在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>

Easy, you make :

header("location:AccountInformation.php");

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