Sorry if this question has been asked before.
I'm having some trouble with my
php contact form. Everything sends except the selected option in the question area.
HTML:
- Code: Select all
<form action="php-contact-form.php" method="post">
<p>Name:<br><input type="text" name="name"></p>
<p>E-mail:<br><input type="text" name="email"></p>
<p>Question:<br><select name="Question">
<option value="Site Design">Site Design</option>
<option value="Coding Your Mock-Up">Coding Your Mock-Up</option>
<option value="Site Maintenance">Site Maintenance</option>
<option value="Logo Design">Logo Design</option>
<option value="Other">Other</option>
</select></p>
<p>Comments:<br><textarea name="comments" rows="6" cols="35"></textarea></p>
<p><input type="submit" value="Send"></p>
</form>
PHP:
- Code: Select all
<?php
$subject = "New Email From PadraigCurran.com";
$your_email = "info@padraigcurran.com";
$success = "formdone.html";
$name = $_POST["name"];
$email = $_POST["email"];
$question = $_POST["question"];
$comments = $_POST["comments"];
$msg = "Name: $name\n";
$msg.= "E-mail: $email\n";
$msg.= "question: $question\n";
$msg.= "Comments: $comments";
mail($your_email, $subject, $msg);
header("Location: $success");
?>
The contact form can be found at
http://padraigcurran.com/contact