
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>forms layout</title>
</head>
<body>
<?php 
$submit = $_POST['submit'];
if ($submit == 'Buy Shirt'){
  //do our stuff
$name = $_POST['name'];
$address = $_POST['address'];
$customerid = $_POST['custid'];
$comments = $_POST['comments'];
$size = $_POST['size'];
//print_r($_POST['style']);
$style = $_POST['style'];
foreach ($style as $value){
	$styleconcat .= $value.', ';
}

$color = $_POST['color'];

$contents = $name.' from '.$address.' has ordered 1 shirt<br/>
Color: '.$color.',<br/>
Size:  '.$size.',<br/>
Style: '.$styleconcat.'<br/>
Comments: '.$comments;
echo $contents;
}



?>
<table width="400">
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" name="Practice Form" />
<tr>
<td width="100" align="right"><label>Name:</label></td><td><input type="text" name="name" value="Your Name Here" size="30" tabindex="1" /></td>
</tr>
<tr>
<td align="right"><label>Address:</label></td><td><input type="text" name="address" size="30" tabindex="3" /></td>
</tr>
<tr>
<td align="right"><label>Customer ID:</label></td><td><input type="text" name="custid" size="30" tabindex="2"/><br /></td>
</tr>
<tr>
<td align="right" valign="top"><label>Comments:</label><br /></td><td><textarea name="comments" rows="4" cols="30" tabindex="4">Comments</textarea></td>
</tr>
</table>

<table width="400">
<tr colspan="4"><td><label>Shirt Size:</label></td></tr>
<tr>
<td><input type="radio" name="size" value="X" />Extra Large</td>
<td><input type="radio" name="size" value="L" />Large</td>
<td><input type="radio" name="size" value="M" />Medium</td>
<td><input type="radio" name="size" value="S" />Small</td>
</tr>
</table>

<p><label>Logo Placement:</label><br />
<input type="checkbox" name="style[]" value="pocket" />Pocket <br />
<input type="checkbox" name="style[]" value="back" checked="checked" />Back<br />
<input type="checkbox" name="style[]" value="left" />Left Sleeve<br />
<input type="checkbox" name="style[]" value="right" />Right Sleeve <br />
</p>

<p><label>Color: </label>
<select name="color">
<option value="Blue">Blue</option>
<option value="Green">Green</option>
<option value="White">White</option>
<option value="Black">Black</option>
</select></p>


<p id="buttons"><input type="submit" name="submit" value="Buy Shirt"  />
<input type="reset" value="Start Over" /></p>

</form>


</body>
</html>
