开发者

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");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜