Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 131,791 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,619 people online right now. Registration is fast and FREE... Join Now!




Exam with checkbox

 
Reply to this topicStart new topic

Exam with checkbox, check the db value

Arsench
post 8 Oct, 2008 - 01:20 PM
Post #1


New D.I.C Head

*
Joined: 8 Oct, 2008
Posts: 4

Hello, please help if you can, I have a db with fields

question, answer1,answer2,answer3,answer4,correct_answer

Im displaying the question first then all 4 possible answers, in one of thes answers are in the correct_answer field.

The 4 answers showing with checkboxes and user must check one of them as a answer.

How can I check if the answer chekced by user in chekcbox is equal with correct_answer field

thank you
User is offlineProfile CardPM

Go to the top of the page

MacAnimeGirl
post 8 Oct, 2008 - 01:30 PM
Post #2


D.I.C Head

**
Joined: 30 Sep, 2008
Posts: 132


My Contributions


Yikes. Scratch That! I just realized you were talking PHP! Sorry.

This post has been edited by MacAnimeGirl: 8 Oct, 2008 - 01:34 PM
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 8 Oct, 2008 - 01:35 PM
Post #3


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


Make the value of your checkboxes "a" "b" "c" "d", and then use an if statement to compare the selected value with the correct_answer field.

User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/20/08 04:19PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month