Forum Moderators: coopster
1. First page will be a multi-select checkbox with about 200 values saved to mysql database. User must click 30 of these.
2. Second page will display the the 30 items from the first page as new checkboxes (and directions) and they can click any number.
3. Third page will display the items checked from the second page as just text, with text boxes next to it (with directions).
4. Last and finally, the user will have a page displayed that shows all other users that match atleast 20 out of the 30 checkbox values from the first page.
Any help will be much appreciated!
[edited by: DragonMistress at 6:32 am (utc) on Dec. 18, 2008]
$sql = "SELECT myValue from myTable";
$result = mysql_query($sql);
while($content = mysql_fetch_assoc($result)){
echo "<input type=\"checkbox\" name=\"mySelect[]\" value=\"".$content['myValue']."\">".$content['myValue']."<br>";
}
$mySelect = $_POST['mySelect'];
//if 30 or more are selected
if(sizeof($mySelect) >= 30){
//display new list
//save first data set to the db
else{
//sends user back to first page
}
I've got the first page and field created (and yes I know 200 is alot, but this is what my clients wants for this ridiculous new request they've made for a stupid simple site).
And I'm able to retreive and display the values from the first field on the second page, just haven't determined how to display them as new checkboxes.
I've also got the third page written now, and I think its correct, but can't test until I get the second page done. haha But I think what you've given me here will help.
But I'm still struggling with that final page. The users have a userid. I want to show each user, which other users "match" 20 or more out of the 30 selected values from page 1.
$count = 0;
for($i = 0; $i < sizeof($dataSet2); $i++){
if(in_array($dataSet2[$i], $dataSet1)){
$count++;
}
}
//if count >=20, insert a true/false(1/0) into your field to mark the user successfuling matching 20 out of 30.