Jump to content


Photo

How do I display a confirmation page after form edits?


  • Please log in to reply
2 replies to this topic

#1 jfourman

jfourman
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 23 August 2006 - 02:53 PM

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.

#2 dank

dank
  • Members
  • PipPip
  • Member
  • 12 posts
  • LocationCanada

Posted 23 August 2006 - 05:29 PM

Everyone is a newbie at some point, so there is nothing to be embarassed about.

You can use the following instead of print:

Header("Location: success.php");

Andrew Danks - www.danks.ca

#3 jfourman

jfourman
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 23 August 2006 - 08:31 PM

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.








0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users