|
-
Apr 15th, 2008, 11:50 PM
#1
Thread Starter
Lively Member
[RESOLVED]php help
Hi All,
I have a form which has 5 question and each question has 3 options(e.g. A, B,C)
these options are represented by radio buttons.
and one submit button is there...
after clicking on submit I should get which option is clicked maximum time.
(e.g. for question 1, option A is clicked, for question 2, Option B is clicked, for question 3, Option A is clicked, for question 4, option C is clicked, for question 5 option A is clicked...so after clicking on submit button, I should get answer A as maximum clicked option.)
how would I do this without using DB?
Last edited by rasana; Apr 23rd, 2008 at 02:50 AM.
-
Apr 16th, 2008, 11:08 AM
#2
Re: php help
The most logical thing to do is use a file with a list of questions and their associated answers on each line. You could also use an XML file or SQLlite which is built into PHP 5.
Example text file format:
Code:
1||Question 1||C||Option A, Option B, Option C
2||Question 2||B||Option A, Option B, Option C
3||Question 3||A||Option A, Option B, Option C
Example XML file format:
Code:
<questions>
<question id="1">
<text>Question 1</text>
<answer>C</answer>
<options>
<option id="A">Option 1</option>
<option id="B">Option 2</option>
<option id="C">Option 3</option>
</options>
</question>
<question id="2">
<text>Question 2</text>
<answer>B</answer>
<options>
<option id="A">Option 1</option>
<option id="B">Option 2</option>
<option id="C">Option 3</option>
</options>
</question>
<question id="3">
<text>Question 3</text>
<answer>A</answer>
<options>
<option id="A">Option 1</option>
<option id="B">Option 2</option>
<option id="C">Option 3</option>
</options>
</question>
</questions>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|