How can I redirect to a specified page after performing a MySQL insert or update?
After using form data to perform a MySQL update (via PHP), I'd like to direct the user to a page that displays that data as it will appear on the site.
How can I automatically redirect the user to a page (preview.php, for exampl开发者_StackOverflow中文版e) AFTER running the MySQL update?
I'd like to keep the solution to HTML or PHP if possible.
Your script has to avoid any output to be able to send the Location header which redirects the browser. Just avoid any output (echo, var_dump, etc.) and after the insertions have been made, write
header("Location: preview.php");
精彩评论