Jump to content


Photo

Advice Needed


  • Please log in to reply
3 replies to this topic

#1 hostfreak

hostfreak
  • Members
  • PipPipPip
  • Advanced Member
  • 581 posts

Posted 18 July 2006 - 05:44 PM

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.

#2 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 18 July 2006 - 05:47 PM

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();

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 18 July 2006 - 05:51 PM

Rather than using die or exit, Do something like this:
if(isset($_POST['submit']))
{
   // do email stuff here
}
else
{
   // display form here
}


#4 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 18 July 2006 - 05:56 PM

^ 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

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users