<?php
$submit = $_POST['submit'];
if ($submit == 'Send Me'){
$fullname = $_POST['fullname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$gender = $_POST['gender'];
$hobbies = $_POST['hobbies'];
for ($i=0;$i<count($hobbies);$i++)
{
$allhobby =  $hobbies[$i].', ';
}
$comments = $_POST['comments'];
$to = 'kdsecor@gmail.com';
$subject = 'Someone just submitted an order';
$content = 'Name: '.$fullname.'<br/>
Email: '.$email.'<br/>
Phone: '.$phone.'<br/>
Gender: '.$gender.'<br/>
Hobbies: '.$allhobby.'<br/>
TimeZone: '.$timezone.'<br/>
Comments: '.$comments.'<br/>';
$test = mail($to,$subject,$content,"Content-type:text/html");
if ($test) echo 'Thank you, we\'ll be in touch<br/>';


}


?>


<form action = "forms.php" method ="post">
Name: <input type = "text" name = "fullname" required="required"/><br/>
Email: <input type = "email" name = "email" required="required"/><br/>
Phone: <input type = "tel" name = "phone" required="required"/><br/>
Gender: <input type = "radio" name = "gender" value="male"/>Male<br/>
<input type = "radio" name = "gender" value="female"/>Female<br/>
Hobbies: <br/>
Coding:<input type = "checkbox" name = "hobbies[]" value = "Coding"/><br/>
Sleeping:<input type = "checkbox" name = "hobbies[]" value = "Sleeping"/><br/>
Eating:<input type = "checkbox" name = "hobbies[]" value = "Eating"/><br/>
US TimeZone: <select name = "timezone">
<option value = "EDT">EDT</option>
<option value = "CST">CST</option>
<option value = "MST">MST</option>
<option value = "PDT">PDT</option>
</select>
<br/>
Comments: <textarea rows = "5" cols="20" name = "comments"></textarea>

<input type = "submit" name = "submit" value = "Send Me"/>

</form>