It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

html/javascript response to php mailresult=OK?

Moderator: Malcolm

html/javascript response to php mailresult=OK?

Postby jerohero on Sat Sep 05, 2009 8:48 am

Hi all,
I'm new to php, but managed to get a domail.php working. My form from my html website is sent by the php file to my email address. However, the php echoes a mailresult upon successful sending, but how can I let my website respond to this mailresult?? I'd like to go to a different page, when the mailresult==OK, so something in my html file like

if($mailResult==OK){
//go to page saying, your mail has been sent!
}

OR I could change the "OK" to something more like "Thank you, your mail has been received" in the php file, because this text IS shown in my browser window. Then I would need to know how to make the layout of the window saying this fit my website layout, because now the text is just in a white plain frame..

Hope you guys can help me with either of those two options. Thanks a ton!!

Jay
jerohero
 
Posts: 2
Joined: Sat Sep 05, 2009 8:47 am

Re: html/javascript response to php mailresult=OK?

Postby djtonic on Sat Sep 12, 2009 3:30 am

jay,
what web host are you using and how did you dev your site? Also, do you mind posting your site so i can see what the form action is now?



tim.
djtonic
50+ Club
 
Posts: 88
Joined: Tue Sep 08, 2009 12:38 am

Re: html/javascript response to php mailresult=OK?

Postby dflynn on Tue Dec 29, 2009 5:24 am

Hey Jay

Inside your IF statement add:
Code: Select all
print "<script>";
print " self.location='sent.php';";
print "</script>";


sent.php can be any file that you want to redirect to.

Cheers,
User avatar
dflynn
500+ Club
 
Posts: 860
Joined: Wed Oct 03, 2007 9:06 pm
Location: Guelph, Canada


Who is online

Users browsing this forum: No registered users and 0 guests