Form Help

I’m in my last year of my bachelor’s in graphic design and this is my first web design class that actually deals with coding. I’ve got a form for contacting me and it seems to be working, except that I’m not getting an email. can anyone tell me if I have something wrong? The first part shows the coding on my contact page, the second shows my send.php page.

Contact Me Here!

<? $s=$_GET['s']; if ($s=="1") { echo ('Success! Your message has been sent to our web team. Please allow 24 hours for a response.'); } else if ($s=="2") { echo ('Sorry! Your message has not been sent to our web team. Please ensure you have filled in the form correctly '); } ?>

Please use the details below:

Phone: 701-720-1021

Email: [email protected]

Or alternatively please fill in the contact form below:

Name:
Email:
Tel:
Message:
Security: 6+4 =
 
<? $name = $_POST['name']; $email = $_POST['email']; $tel = $_POST['tel']; $message = $_POST['message']; $security = $_POST['security']; $to = "[email protected]"; $subject = "New Contact Form Submission"; $message = "A visitor of oneiric has submitted the following message.\n\nName: $name\n\nEmail: $email\n\nTelephone: $tel\n\nMessage: $message\n\nPlease respond within 24 hours.\n\n"; if ($security=="10"){ mail($to,$subject,$message); header("Location:contact.php?s=1"); } else { header("Location:contact.php?s=2"); } ?>

First you have errant words in the form line,

<form id="form1" form

Second, place the mail() in an if statement,
[php]
if ( mail() )[/php]

To know if it sent.

Sponsor our Newsletter | Privacy Policy | Terms of Service