Results 1 to 2 of 2

Thread: [RESOLVED]php help

  1. #1

    Thread Starter
    Lively Member rasana's Avatar
    Join Date
    Jan 2007
    Location
    Mumbai, (India)
    Posts
    94

    Resolved [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.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    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>
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width