Questions

Contact Form

Tags:
+
0 Votes
Locked

Contact Form

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

Clarifications

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.

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

  • +
    0 Votes

    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

    +
    0 Votes
    ynet

    Thanks a million Guys i will try this out now.

    +
    0 Votes
    ynet

    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

  • +
    0 Votes

    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

    +
    0 Votes
    ynet

    Thanks a million Guys i will try this out now.

    +
    0 Votes
    ynet

    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