<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>HTML5 Form Example</title>
</head>
<body>
	<?php
	$name = $_POST['firstname'];
	$gender = $_POST['gender'];
	$yearinschool = $_POST['yearinschool'];
	$hobbies = $_POST['hobbies'];
	$comments = $_POST['comments'];
	//we needed to loop through the hobby array.
	foreach ($hobbies as $hobby){
		$hobbycontent .= $hobby.',';
	}

	//this is what goes in the database
	echo $name.'<br>'.$gender.'<br>'.$yearinschool.'<br>'.$hobbycontent.'<br>'.$comments;

	//extract data and print it
	?>
	<form action="form.php" method="post">
	<input type="text" name = "firstname" placeholder="Enter Your Full Name"><br/>
	<input type="radio" name ="gender" value="male"/>Male<br>
    <input type="radio" name ="gender" value="female"/>Female<br>
    <select name = "yearinschool">
    	<option value="Freshman">Freshman</option>
    	<option value="Sophomore">Sophomore</option>
    	<option value="Junior">Junior</option>
    	<option value="Senior">Senior</option>
    </select><br>
    <input type="checkbox" name="hobbies[]" value="Football"> Football<br>
    <input type="checkbox" name="hobbies[]" value="Hockey"> Hockey<br>
    <input type="checkbox" name="hobbies[]" value="Baseball"> Baseball<br>
    <textarea name="comments"></textarea>


	<input type ="submit" name = "submit" value="Submit Data">
	</form>
</body>
</html>