macca81625 Posted August 3, 2009 Share Posted August 3, 2009 Hi guys, im new to this forum, so if this problem has been addressed, please let me know but its got me I have a contact form, www webuynow co uk it has worked in the past, and I've tried to alter the form to work on the why us page, thats how i found this problem, but now all i am getting is a blank page after submitting! I dont know if its linked to the fact that I installed wordpress, here is my php code! <?php // Website Contact Form Generator // http://www.tele-pro.co.uk/scripts/contact_form/ // This script is free to use as long as you // retain the credit link // get posted data into local variables $EmailFrom = "website@webuynow.co.uk"; $EmailTo = "macca81625@hotmail.com"; $Subject = "Inquiry"; $Name = Trim(stripslashes($_POST['Name'])); $Telephone = Trim(stripslashes($_POST['Telephone'])); $Make = Trim(stripslashes($_POST['Make'])); $Model = Trim(stripslashes($_POST['Model'])); $Colour = Trim(stripslashes($_POST['Colour'])); $Registration = Trim(stripslashes($_POST['Registration'])); $Year = Trim(stripslashes($_POST['Year'])); $Mileage = Trim(stripslashes($_POST['Mileage'])); $attn = Trim(stripslashes($_POST['attn'])); $attn1 = Trim(stripslashes($_POST['attn1'])); // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Telephone: "; $Body .= $Telephone; $Body .= "\n"; $Body .= "Make: "; $Body .= $Make; $Body .= "\n"; $Body .= "Model: "; $Body .= $Model; $Body .= "\n"; $Body .= "Engine: "; $Body .= $Colour; $Body .= "\n"; $Body .= "Registration: "; $Body .= $Registration; $Body .= "\n"; $Body .= "Year: "; $Body .= $Year; $Body .= "\n"; $Body .= "Mileage: "; $Body .= $Mileage; $Body .= "\n"; $Body .= "V5: "; $Body .= $attn; $Body .= "\n"; $Body .= "Transmission: "; $Body .= $attn1; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyouside.php\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.php">"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/168708-solved-contact-forms-wordpress/ Share on other sites More sharing options...
jonsjava Posted August 3, 2009 Share Posted August 3, 2009 forgot to escape a quote: <?php // Website Contact Form Generator // http://www.tele-pro.co.uk/scripts/contact_form/ // This script is free to use as long as you // retain the credit link // get posted data into local variables $EmailFrom = "website@webuynow.co.uk"; $EmailTo = "macca81625@hotmail.com"; $Subject = "Inquiry"; $Name = Trim(stripslashes($_POST['Name'])); $Telephone = Trim(stripslashes($_POST['Telephone'])); $Make = Trim(stripslashes($_POST['Make'])); $Model = Trim(stripslashes($_POST['Model'])); $Colour = Trim(stripslashes($_POST['Colour'])); $Registration = Trim(stripslashes($_POST['Registration'])); $Year = Trim(stripslashes($_POST['Year'])); $Mileage = Trim(stripslashes($_POST['Mileage'])); $attn = Trim(stripslashes($_POST['attn'])); $attn1 = Trim(stripslashes($_POST['attn1'])); // prepare email body text $Body = ""; $Body .= "Name: "; $Body .= $Name; $Body .= "\n"; $Body .= "Telephone: "; $Body .= $Telephone; $Body .= "\n"; $Body .= "Make: "; $Body .= $Make; $Body .= "\n"; $Body .= "Model: "; $Body .= $Model; $Body .= "\n"; $Body .= "Engine: "; $Body .= $Colour; $Body .= "\n"; $Body .= "Registration: "; $Body .= $Registration; $Body .= "\n"; $Body .= "Year: "; $Body .= $Year; $Body .= "\n"; $Body .= "Mileage: "; $Body .= $Mileage; $Body .= "\n"; $Body .= "V5: "; $Body .= $attn; $Body .= "\n"; $Body .= "Transmission: "; $Body .= $attn1; $Body .= "\n"; // send email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); // redirect to success page if ($success){ print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyouside.php\">"; } else{ print "<meta http-equiv=\"refresh\" content=\"0;URL=error.php\">"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/168708-solved-contact-forms-wordpress/#findComment-890063 Share on other sites More sharing options...
macca81625 Posted August 3, 2009 Author Share Posted August 3, 2009 Thank you, im new to php, trying to pick up new bits Quote Link to comment https://forums.phpfreaks.com/topic/168708-solved-contact-forms-wordpress/#findComment-890072 Share on other sites More sharing options...
jonsjava Posted August 3, 2009 Share Posted August 3, 2009 Welcome to PHPFreaks! Quote Link to comment https://forums.phpfreaks.com/topic/168708-solved-contact-forms-wordpress/#findComment-890074 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.