Statrting out a script

Dear forum

I have only just begun learning PHP so bear with me for asking a rather free-ranging question.

I need some general advice as to what kind of PHP code I should use for a little project I have. The general idea is to guide the user to a conclusion based on the users input of Yes or No to a series of questions.

The logic is something like IF TOPIC “A” USER INPUT = “yes”, THEN USER GOTO TOPIC “B”.
Just like a fighting fantasy book, really.

The problem I try to solve is this:
The user needs an answer to three difficult questions. The answer to each of the three questions can be either TRUE or FALSE (NULL is not an option). The user’s problem is that it is really complicated to find out if the answer should be TRUE or FALSE, and the average user cannot figure it out by himself. I wish to guide the user to reach a conclusion to each of these three questions by breaking down the logic behind the questions to a series of much simpler topics answerable easily by “yes” or “no”. The user input to each topic by “yes” or “no” determines if the answers to each of the three difficult questions are TRUE or FALSE. I have this logic mapped out completely. Additionally, each topic will only appear once in the entire chain of topics leading to the answers to the difficult questions.

I need advice on how to put this in PHP.

The visual presentation I wish to do is something like the attached picture (made in Excel for my own convenience).

My idea is to make the user begin at topic A, then work his way through the topics by choosing either Yes or No at the present topic highlighted in color. The highlight must also change according to present topic.

Finally, the user ends up in one of the last cells and is there given the answer to each of the three questions.

How would you advice an absolute beginner to grab a piece of code and begin solving? I am determined to do the piece of work myself, but I need advice on where to begin, what functions of PHP should I look at?

I have some very minor coding expetrience, I know a Little bit of HTML, and I know a Little bit about integers, booleans and functions.


What have you thought about? How are the questions being held, database, file?

How much have you thought about the logic needed?

Sponsor our Newsletter | Privacy Policy | Terms of Service