This is a major problem of mine. I'm working on a website and I need to have people enter their own reviews of movies and I've tried to get around this problem but I need to use checkboxes. Below is the form then the php page that processes it. Also could someone tell me what datatype I need in mysql for checkboxes and how give me an example of how it should be entered?
writea.html
<form action=processa.php method=POST>
<p>What is your name or what do you want to be known as?
<input type=text name=name size=25 maxlength=25>
<p>What is your E-mail address?
<input type=text name=email size=25 maxlength=25>
<p>What is the title of the movie you are reviewing?
<input type=text name=title size=50 maxlength=100>
<p>What year did this movie come out? If you don't know please look up the title
on the <a href="http://www.imdb.com" target="_blank">Internet Movie Database</a>
to a movie's year of release.
<input type=text name=year size=4 maxlength=4>
<p>What is the MPAA rating of this movie?
<select name="rating">
<option value="G" selected>G</option>
<option value="PG">PG</option>
<option value="PG-13">PG-13</option>
<option value="R">R</option>
<option value="NC-17">NC-17</option>
<option value="Unrated">Unrated</option>
<option value="Not MPAA rated">Not MPAA rated</option>
</select>
<p>Which if any of the following does the movie contain?
<input type="checkbox" name="contains_array[]" value="Sex">
Sex
<input type="checkbox" name="contains_array[]" value="Violence">
Violence
<input type="checkbox" name="contains_array[]" value="Rape">
Rape
<input type="checkbox" name="contains_array[]" value="Drug Use">
Drug Use
<input type="checkbox" name="contains_array[]" value="Nudity">
Nudity
<input type="checkbox" name="contains_array[]" value="Cursing">
Cursing
<input type="checkbox" name="contains_array[]" value="Subtitles">
Subtitles
<input type="checkbox" name="contains_array[]" value="Black and White">
Black and White
<p>
<input type=submit>
</form>
processa.php
<body>
<?php
require ("rev.inc");
mysql_select_db("demonscars",$revcon);
$contains = implode($contains_array, ",");
$result = mysql_query("INSERT INTO reviews VALUES (NULL,'$name','$email','$title','$year','$rating','$contains')");
echo "Thank you! Information entered.\n";
?>
</body>