Hi I am wondering if anyone can offer some simple advice, I have started to work in my first php script submitting a website form via email and I am trying to use php, now I can get an email sent to me with 90% of the data in but I cannot work out how to include more than one checkbox result.
I have included sample site code and the php code i am using -
For the arrays -
PHP Code:
<form name="form1" method="post" action="sendmail.php">
<input name="awards[]" type="checkbox" id="awards[]" value="award1">
<input name="awards[]" type="checkbox" id="awards[]" value="award2">
<input name="awards[]" type="checkbox" id="awards[]" value="award3">
PHP Code:
<?php
$firstname = $_REQUEST['firstname'];
$secondname = $_REQUEST['secondname'];
$nickname = $_REQUEST['nickname'];
$emailadd = $_REQUEST['emailadd'];
$prefcontact = $_REQUEST['prefcontact'];
$mobileno = $_REQUEST['mobileno'];
$homeno = $_REQUEST['homeno'];
$homeaddress = $_REQUEST['homeaddress'];
$homepostcode = $_REQUEST['homepostcode'];
$awards = $_REQUEST['awards[]'];
$capitation = $_REQUEST['capitation'];
$message = "The Feedback Form
From: $email
First Name: $firstname
Second Name: $secondname
Nick Name: $nickname
Email Address: $emailadd,
Prefered Contact Method: $prefcontact
Mobile Number: $mobileno
Home Number: $homeno
Home Address= $homeaddress
Home Postcode: $homepostcode
Awards: $awards
mail( "email@address.com", "Join Us . . .", $message, "From:" $email, "mail.address.com" );
?>
Also i know its not an easy job, but am i going about this the right way and would it be possible to find out the best way to tidy the code up.
Thanks Again
Chris Rutter