Jump to content

Recommended Posts

Hi guys, im new to this forum, so if this problem has been addressed, please let me know but its got me  :facewall:

 

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">";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/168708-solved-contact-forms-wordpress/
Share on other sites

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\">";
}
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.