php and html feedback form

Hey guys,

I’ve been trying to make a php feedback form on one of the pages of my website. It uses echos to display the form and potential error messages, both html and php are therefore in the same file. It’s displaying the form correctly (you can see it here: but nothing works! I don’t receive an email and none of the echo scripts are popping up anywhere!

Here is the form code:

<?php // Function to display form function showForm($errorName=false,$errorEmail=false,$errorMesg=false){ if ($errorName) $errorTextName = "Please enter your name!"; if ($errorEmail) $errorTextEmail = "Please enter a valid email address!"; if ($errorMesg) $errorTextMesg = "Please leave a longer message!"; echo ''; // Display name field an error if needed echo ''; if ($errorName) echo ""; // Display email field an error if needed echo ''; if ($errorEmail) echo ""; echo ''; // Display message field an error if needed echo ''; if ($errorMesg) echo ""; echo ''; echo '
Name *
Email *
'; } if (!isset($_POST['submit'])) { showForm() ; } else { //Init error variables $errorName = false; $errorEmail = false; $errorMesg = false; $name = isset($_POST['name']) ? trim($_POST['name']) : ''; $email = isset($_POST['email']) ? trim($_POST['email']) : ''; $mesg = isset($_POST['comments']) ? trim($_POST['comments']) : ''; if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) $errorEmail = true; if (strlen($name)<3) $errorName = true; if (strlen($mesg)<100) $errorMesg = true; // Display the form again as there was an error if ($errorName || $errorEmail || $errorMesg) { showForm($errorName,$errorEmail,$errorMesg); } else { echo 'Submission was successful!'; } mail( "[email protected]", "Appointment from $name", $message, "From: $email" ); } ?>


Again, the form is here:

Thank you very much for your help!

try adding an id of submit to your button

Sponsor our Newsletter | Privacy Policy | Terms of Service