Jump to content

Help with contact form


robvoz

Recommended Posts

Hi,

 

I've no experience of php whatsoever, so I suspect and hope this will be very easy to resolve.

 

It's the standard contact form for the package I used to create my website, but there is a parser error to do with quotation marks from what I can gather.

 

All help gratefully received.

 

The url is: www.vozmedia.co.uk/contact.html if you want to see the error online.

 

Cheers,

 

Rob

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/203448-help-with-contact-form/
Share on other sites

you didn't escape your quote in all 3 meta

this would work

<?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 = Trim(stripslashes($_POST['EmailFrom'])); 
$EmailTo = "[email protected]";
$Subject = "Voz Media contact";
$name = Trim(stripslashes($_POST['name'])); 
$message = Trim(stripslashes($_POST['message'])); 
echo "x";

// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=www.vozmedia.co.uk\">";
  exit;
}

// prepare email body text
$Body = "";
$Body .= "name: ";
$Body .= $name;
$Body .= "\n";
$Body .= "message: ";
$Body .= $message;
$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=www.vozmedia.co.uk/contactsucess.html\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=www.vozmedia.co.uk/contactfailure.html\">";
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.