I am in the process of creating a PHP contact form and all I have is that little problem, with the php script I have, that when the email was send out a new "Thank you" page is called.So the actual site with the contact form disappears BUT I DON`T WANT THAT HAPPEN.
If the send button is hit I want to stay on my site, showing an empty contact form and maybe below the contact form just 1 line, saying "Thank you.....".
How can I make that happen? Is there any code snippet out there that can explain to me what I have to include to my html and to my php file? Hopefully it will...Below is how my php ends right now.
// send Email
if (@mail( $empfaenger, htmlspecialchars( $betreff ), $mailbody, $mailheader ))
{
// if email was successfully send
echo 'Thank you for your Email. We will get in touch with you very soon.';
}
EDIT
@FreekOne
Currently I am using your code with a slight modification because I wanted to make the thank you and or error panel make slide out and have the text fade in. The script is accepting my code (because it is still working) but actually I can not see that the text actually fades in. I have seen samples of sliding panels with fading in text. So it seems to be a wrong kind of coding that I did.
Please view the code here if you want:
http://jsbin.com/ohuya3
A working example of the form is available here:
http://cozyphant-living.com/php/formular4.htm
Maybe you can point me to the right direction. Of course, help would be appreciated from all of you guys here around.