Posted 20 January 2007 - 12:04 AM
There are two different ways I would go about this, first is using ajax and would be slightly more complex because of that for someone now.
1) You use javascript onClick to pass the value they selected and the question id to an AJAX request which then passses the value onto a php script which then will work out which question it is with the id, and then can see if they are right or wrong depending on the answer passed, and then you can simply return what you want to do.
Or the more basic way is to use $_GET variables to put the answer into a url then you can read it off.
2) When the user clicks the answer the url then becomes ?answer=3 for example, then your script looks for a value to answer, checks it is a valid number by using somthing like is_numeric() and if( $_GET['answer'] > 0 && $_GET['answer'] <= 4 ) {, and then you just check the value of the answer and print out a message depending on what they selected.
Hope this helps
Matt