Jump to content

Recommended Posts

I have a problem that I *think* can be solved by PHP. Since I don't know PHP yet, I decided I should ask people who know to see if it would be possible before diving in and learning it.

 

I want to create a questioning webpage. I have an XML file that looks like this:

<ARTICLE ID="10a3Fc">
  <QUESTION ID="1" TITLE="Question would go here?">
    <ANSWER REF="2">First answer - Links to Question ID 2</ANSWER>
    <ANSWER REF="3">Second answer - Links to Question ID 3</ANSWER>
  </QUESTION>
  <QUESTION ID="2" TITLE="This is question 2!!">
    <ANSWER REF="1">Go back to the first question<ANSWER>
  </QUESTION>
  <QUESTION ID="3" TITLE="Our third and final question">
    <ANSWER REF="2">Go to Question 2!</ANSWER>
  </QUESTION>
</ARTICLE>

 

What I would like to do is have the web page display the only the first question and it's answers. When the user chooses one of the answers, I would like it then to show the next question based on the REF of the answer. So in the first question, if they click the second answer of the first question, it would display the "Our third and final question" and the related answers.

 

Is this possible to do with PHP and is it what PHP was designed to do, or am I looking in the wrong direction?

 

Thank you for your time!

Link to comment
https://forums.phpfreaks.com/topic/64869-solved-would-php-work-for-this-problem/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.