I have a table with a bunch of check boxes, this is not a plug: (found at ), I am trying to figure out how to store each checkbox's value in real time (there is no "Submit" button). I run jQuery through my site and was thinking that PHP/jQuery could do it. I don't need any security with this storage although an IP check to make sure the same user isn't clicking/unclicking the same button 100 times would be nice. All I need it to do is store (I'm thinking a checkbox.log file) how many times each one is checked (use IP to prevent duplicates) than show them sorted in most checked to least checked order. Also I have a few checked to make sure that people realize those are checkboxes(they are jQuery modified), so I would not want those check marks to be counted unless a user actually checks another box(or unchecks one of those two). If you could please give me a pointer as to how this can be accomplished or at least where to begin. I would really prefer to use PHP, with jQuery if needed, but I would really prefer not to use MySQL.
I thinking the log file would look like this (would prefer it to be in Binary(not human readable) if possible):
/* My Checkbox Tallies checkbox.log */ reviews-chk-longer 597 reviews-chk-discrete 256 reviews-chk-natural 375 reviews-chk-thicker 539 reviews-chk-permanent 467 reviews-chk-stamina 390 reviews-chk-harder 310 reviews-chk-vascularity 279 reviews-chk-drive 136 reviews-chk-guarantee 536 reviews-chk-trials 410 reviews-chk-affordable 357 /* IP Logger How many times that IP checked each box then the actual IP */ 0 0 1 1 0 1 1 0 0 1 1 0 192.168.1.1 0 0 70 5 3 4 3 2 0 1 2 0 126.96.36.199 . . . . . /* End of File */
I am thinking that to make this simple just stop tallying any marks after 4(a user can check each box 2 times, a few duplicates is okay) and obviously the real file wouldn't have those comments.
The other concern is the 2 checked boxes, I don't want it to subtract from the tallies if someone unchecks those boxes for the first time (I guess I can IF...THAN that deal based on how many times they clicked the checked boxes)
Finally it needs to read this file and sort the 12 variables based on most checkmars to least checkmars and display the sorted variables in a separate div. (Although I can do this part on my own)
The first part is a bit more difficult, particularly handling the onClick event to add those values to the file.
Please help me figure out how to do this. Thank you.