Jump to content

Archived

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

hostfreak

Advice Needed

Recommended Posts

I had a page where the user filled out a form and submitted the information which was then sent via an email and displayed a confirmation of the information they submitted. Well it came about that I needed that information to also be added to the database so instead of using a submit button for the email and using another page for the action of the email, I just had the email sent from that page. Well in doing so, I am unsure how to display the confirmation (just the confirmation alone) with out the form they filled out being displayed as well. See when I was using a different page for the action to send the email, I was able to echo the results for them to print etc. Now I can echo the result with $result = mysql_query($query) then display the confirmation but it also displays the form under it which I don't want. Anyways, any help would be appreciated, thanks.

Share this post


Link to post
Share on other sites
After you use echo() or print () to show the message, include the footers (whatever stuff you have at the bottom of all pages and use die(); or exit();

Share this post


Link to post
Share on other sites
Rather than using die or exit, Do something like this:
[code=php:0]if(isset($_POST['submit']))
{
  // do email stuff here
}
else
{
  // display form here
}[/code]

Share this post


Link to post
Share on other sites
^ I usually do that too. :D Whenever I have a really long code I hate having to go back and re-tab everything so it lines up. XD

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.