Question

Locked

Contact Form

By ynet ·
i just uploaded the html and php code for my contact form and it returns - There has been an error, please make sure you have entered your details correctly. when i fill the form online please some pro, help me out

This conversation is currently closed to new comments.

6 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

Clarifications

Collapse -
by Sven2157

I just started my car and it made a weird sound, please help me!!

Not really much to go on. It would probably help the mechanic to know what make, model and year of vehicle, as well as something more specific about the sound and what I was doing. The more information I provide to the mechanic, the better (s)he will be able to help.

Collapse -
by ynet

Please some one here are the codes i used:
<form method="post" action="contactengine.php">
<label for="Name">Name:</label>
<input type="text" name="Name" id="Name" size="45" />
<br />
<label for="Tel">Tel:</label>
<input type="text" name="Tel" id="Tel" size="45" />
<br />
<label for="Email">Email:</label>
<input type="text" name="Email" id="Email" size="45" />
<br /><br />
<label for="Message">Details of Quote / Query</label><br />
<textarea name="Message" rows="5" cols="45" id="Message"></textarea>

<input type="submit" name="submit" value="Submit" class="submit-button" />
</form>


<?php

$EmailFrom = "noreply@yoursite.com"; // From email address
$EmailTo = "youremail@yoursite.com"; // Email address you want submitted forms to go to
$Subject = "YourSite.com - Contact Form Submission"; // subject line for emails
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));

// validation
$validationOK=true;
if (!$validationOK) {
print "There has been an error, please make sure you entered a correct email address."; // You can edit this to your own error message
exit;
}

// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
print "Thank you, your email has been sent! We will be in touch shortly!"; // You can edit this to your own success message
}
else{
print "There has been an error, please make sure you have entered your details correctly."; // You can edit this to your own error message
}
?>

All Answers

Collapse -

remove validation code

by bestwebsitesdesigner In reply to Contact Form

You have used validation in the form codes.

This is your validation code

$validationOK=true;
if (!$validationOK) {
print "There has been an error, please make sure you entered a correct email address."; // You can edit this to your own error message
exit;
}

Unless you put correct email id it will not work.

Either put correct email address or remove this validation.

It should work fine than

Collapse -

Reponse To Answer

by ynet In reply to remove validation code

Thanks a million Guys i will try this out now.

Collapse -

Reponse To Answer

by ynet In reply to remove validation code

Guys i still receive this message: There has been an error, please make sure you have entered your details correctly. though i cut out // validation down to } still need help please

Back to Web Development Forum
6 total posts (Page 1 of 1)  

Software Forums