Jump to content

Archived

This topic is now archived and is closed to further replies.

jfourman

How do I display a confirmation page after form edits?

Recommended Posts

I am embarrased to ask this question because I know the answer is simple; but I have been looking for examples and can't find the solution.

I have a form that upon 'submit' performs some PHP code to send confirmation emails. At the end of the PHP code, a "print" message is displayed on the same page acknowledging that the emails have been sent.

Instead of displaying the message on the same page, I want to load a new page to display the confirmation message. I can't figure out what code to use to replace the "print" command with a command that will navigate to a new page instead. The navigation has to be automatic...no button press.

I'm obviously a noobie that is very grateful for your help.

Share this post


Link to post
Share on other sites
Everyone is a newbie at some point, so there is nothing to be embarassed about.

You can use the following instead of print:

[code]
Header("Location: success.php");
[/code]

Share this post


Link to post
Share on other sites
Andrew:

Thank you for your reply. The code I am hacking is from an "include" in an ecommerce app page named updateorder.php. My include is called updateorderform.php.

I substituted the "print" command with the "header" command you suggested and was returned the error:

Warning: Cannot modify header information - headers already sent by (output started at /home/store/www/dev/orderupdate.php:10) in /home/store/www/dev/orderupdateform.php on line 226

I am trying to substitute the "print" at the end of the include code with navigation to a success.php page. I tried to change the "action" in my form to the success.php page; but although this appears to work, the confirmation emails after the "submit" fail to send. This all works with the "print" statement...but stays on the same page after sending the emails. I want to show a new page.

Is there anything I can use other than the "Header" statement.

Thank you again for your help.



Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.