I have an html page that has 1 textbox field for username and 5 checkboxes for that user to indicate which genres of music they like (ambient, rock, rap, jazz, pop). I duplicated the form fields twice more so that I can get the following data values:
Tom
Ambient
Rock
Rap
Sue
Rock
Rap
Jazz
Betty
Rock
Rap
Jazz
What is the best way to do a user matching algorithm in PHP? From the values about Sue and Betty would match 100% and Tom would match less than 100% with the other two.
Any suggestions?
below is the code
<p>Put in your name and pick the music genres you like:</p>
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12%"><label for="name"></label>
<input type="text" name="name1" id="name1" vale="name1" placeholder="name 1"/></td>
<td width="12%"><label for="name"></label>
<input type="text" name="name2" id="name2" value="name2" placeholder="name 2"/></td>
<td width="13%"><label for="name3"></label>
<input type="text" name="name3" id="name3" value="name3" placeholder="name 3"/></td>
</tr>
<tr>
<td><input type="checkbox" name="checkbox" id="checkbox" />
<label for="checkbox">Ambient</label></td>
<td><input type="checkbox" name="checkbox" id="checkbox" />
<label for="checkbox">Ambient</label></td>
<td><input type="checkbox" name="checkbox" id="checkbox" />
<label for="checkbox">Ambient</label></td>
</tr>
<tr>
<td><input type="checkbox" name="Rock" id="Rock" value="Rock"/>Rock</td>
<td><input type="checkbox" name="Rock" id="Rock" value="Rock"/>
Rock</td>
<td><input type="checkbox" name="Rock" id="Rock" value="Rock"/>
Rock</td>
</tr>
<tr>
<td><input type="checkbox" name="Rap" id="Rap" value="Rap"/>Rap</td>
<td><input type="checkbox" name="Rap" id="Rap" value="Rap"/>
Rap</td>
<td><input type="checkbox" name="Rap" id="Rap" value="Rap"/>
Rap</td>
</tr>
<tr>
<td><input type="checkbox" name="Jazz" id="JAzz" value="Jazz" />Jazz</td>
<td><input type="checkbox" name="Jazz" id="JAzz" value="Jazz" />
Jazz</td>
<td><input type="checkbox" name="Jazz" id="JAzz" value="Jazz" />
Jazz</td>
</tr>
<tr>
<td><input type="checkbox" name="Pop" id="Pop" value="Pop" />Pop</td>
<td><input type="checkbox" name="Pop" id="Pop" value="Pop" />
Pop</td>
<td><input type="checkbox" name="Pop" id="Pop" value="Pop" />
Pop</td>
</tr>
</table>
<br />
<input type="submit" name="button" id="button" value="Submit" />
</form>