logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > SEO
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools Display Modes
Old 06-07-2015, 01:58 AM   #1
vinnyvangogh
 
Join Date: Aug 2009
Posts: 84
Default PHP forms - conformation page

I have PHP purchase/quote forms which use this to process the delivery via email.
This script just puts a a dark grey blank page with the link back to the form page.

How can I change it to open a link to a "message sent" - confirmation.html page.

/* PHP form validation: the script checks that the Email field contains a valid email address and the Subject field isn't empty. preg_match performs a regular expression match. It's a very powerful PHP function to validate form fields and other strings - see PHP manual for details. */
if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)) {
echo "<h4>Invalid email address</h4>";
echo "<a href='java_script:history.back(1);'>Back</a>";
}
elseif ( preg_match( "/[\r\n]/", $name ) || preg_match( "/[\r\n]/", $email ) ) {

echo "<h4>characters not allowed in this field</h4>";
echo "<a href='java_script:history.back(1);'>Back to e mail form</a>";

}

elseif ($email == "") {
echo "<h4>You must enter an e mail address</h4>";
echo "<a href='java_script:history.back(1);'>Back to e mail form</a>";
}
/* Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. */

elseif (mail($recipient,$email,$message, $from)) {

} else {
echo "<h4>Can't send email</h4>";
}

?>

<p><a href="javascript:history.go(-1);">Return to Form Page</a></p>

Advice will be appreciated.
vinnyvangogh is offline  
Old 06-08-2015, 01:15 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

Code:
/* Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. */

elseif (mail($recipient,$email,$message, $from)) {

header("Location: http://mysite.com/thankyou.html");



} else {
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline  
Old 06-08-2015, 08:39 AM   #3
vinnyvangogh
 
Join Date: Aug 2009
Posts: 84
Default

Thanks for your help with this... really is much appreciated
vinnyvangogh is offline  
Closed Thread


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:14 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com