February 2008
Intermediate to advanced
216 pages
4h 33m
English
One of the handiest tricks you can use in PHP is not actually a PHP trick but an HTML trick. When a user fills out a form, you'll frequently check the values of several checkboxes. For example, let's say you're taking a survey to see what sorts of movies your site's visitors like, and you'd like to automatically insert those values into a database called customer_preferences. The hard way to do that is to give each checkbox a separate name on the HTML form, as shown here:
<p>What movies do you like?</p> <input type="checkbox" name="action" value="yes"> Action <input type="checkbox" name="drama" value="yes"> Drama <input type="checkbox" name="comedy" value="yes"> Comedy <input type="checkbox" name="romance" ...
Read now
Unlock full access