Hi, I have a basic form that I need to make work with PHP.
All I have in the form is text fields, check boxes and text areas.
I have one php script that works when I have 2 text fields and 1 text area:
Code:
PHP Code:
<?php if(isset($_POST['submit'])) {
$to = "email@email.com"; $subject = "Contact Form"; $name_field = $_POST['name']; $email_field = $_POST['email']; $message = $_POST['comments']; $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message"; header("Location: ../thankyou.htm"); mail($to, $subject, $body);
} else {
echo "error: no data sent!";
} ?>
Can you please give me an example of how to change this code for a form that has 7 text feilds, 6 checkboxes and 1 text area.
I know that it will depend on the names of the different input areas of the form but if you give me a rough example of how to add more to this php then I will be able to set this form up.
I know that there are just a few things to add in the php script but I don't know the exact way to add them. If anyone could help me with this then that would be unbelievable!
Thanks!
__________________
Please login or register to view this content. Registration is FREE - Fastest growing Winnipeg website design company
|