Nothing seems to work. I have try every thing. At least all of the obvious like pos(array) or $element = current($array) .
What I am trying to do :
Is to ask questions (the problem I am having, display only one at a time)
get answer by using a check box
move and display next question (part of the problem)
At this point my alternative is to go ahead and print all the questions with check boxs. Not what I wont to do.
You'd have one page and which would keep posting to itself.
First create a record in the database for the answers. Pass the question number you're currently on (i.e. 1, 2, 3...) AND the record ID for the "answers" record (using hidden input fields). Each time the page loads you'd retrieve the question for that question number from the database, and store the previous question's value in the "answers" record. Your question answer checkboxes and the hidden fields should be within a POST form (or a get form, doesn't really matter) where the action is the same page.
In this page you'll have to test for when the current question number is greater than the last answer of the last question and when it is, you'd include() or require() the "Thank you for answering" text OR, test when it is EQUAL (ie showing the last page) and change the form action to a different page if you want. Note that if you were to do the latter, the "different" page would also have to add the answer to the record.
Hope this helps,
Seth Willits
------------------------------------------------------------------------ ---
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames
"In the eyes of others, spending a lifetime chasing a dream is often seen
as a lavish waste of a one-time gift, but maybe the joy isn't solely in
its catching, but also in its pursuit."
-- Seth Willits
------------------------------------------------------------------------ ---
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php