I am toying with the idea of implementing functionality similar to the hotornot.com 
site -- for a different purpose, mind you, but the same kind of user experience. 
Here's what it does: 

1. A picture is served up.
2. User clicks on a radio button scale from 1 to 10 to "rate" the picture.
3. The page refreshes. The rating is re-computed with the user's rating for the 
original picture. The original picture becomes that "last rated" pic, and a new one is 
served up. 
4. The user can cycle through as many pictures this way as they want.

I have MySQL and PHP to work with.

What I am trying to do is figure out the best approach to implementing it. 
Specifically, when the user clicks on the radio button, that triggers the form submit 
via JavaScript. The form submit updates the database with the rating and then fetches 
the next row.

The problem that occurred to me as I was putting together a prototype is:

I don't want the user to get the entire result set of all the images in the database 
at once. I really want them to get just the two images (the one they just rated and 
the one they are about to rate). Is there a way to "remember" the last row they 
selected and then use that number to fetch the next one on the subsequent request? I 
can keep recycling hidden form fields with a number, which should work ok, but the 
problems come up when they reach the last row.

Anyway, just looking to see if you folks have some ideas. I would prefer to roll my 
own rather than use one of the available "hotornot-style" PHP scripts to do this.


Matthew J. Horn

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to