views:

109

answers:

1

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 example) AFTER running the MySQL update?

I'd like to keep the solution to HTML or PHP if possible.

+1  A: 

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");
Vinko Vrsalovic