I am using a tutorial for an HTML/PHP email form, it does validation and what not and showcases text fields and select fields, it however does not show checkboxes.
Here is the URL to the tutorial http://net.tutsplus.com/tutorials/html-css-techniques/build-a-neat-html5-powered-contact-form/
The text field code looks like such
<input type="text" id="phone" name="phone" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['phone'] : '' ?>" placeholder="555-555-5555" />
The select looks like such
<option value="Select a size" <?php echo ($sr && !$cf['form_ok'] && $cf['posted_form_data']['size'] == 'Select a size') ? "selected='selected'" : '' ?>>Select a size</option>
What I am trying to figure out how to get the above to be proper syntax when using checkboxes. Here is my attempt
<input type="checkbox" id="color" name="color" value="<?php echo ($sr && !$cf['form_ok'] && $cf['posted_form_data']['red'] : '' ?>" />
It is improper syntax. Mind you I am going to have multiple checkboxes and 1 or all might need to be shown in the recipient email. Can someone please assist that would be awesome.