I am working on a dynamic webpage. It collects answers from the user and then decide what to show them on the next display. I need some calculation of the answers to get the decision, so how to pass the decision to the new page that has the same form but different display data?
What do you have so far?
I have got the users' answer passed to php, and the calculation and decision stuff is easy. But how can I pass the decision to the next page? A simple example: if you can read the number 1~10 correctly, I will give you 10~100 to read. Now I know how my users can read the 1~10 numbers, and decide to give them harder ones. How can my webpage know this decision? And the next display is on the same webpage. Thanks!
If you're using FORMS on each page, continue passing the values through:
<input type='hidden' name='harderQuestions' value='Yes'>
This can be created through an "if" statement in PHP...
Another option is to use PHP Sessions.
Check out: http://www.php.net/session_start
ragedigital wrote:If you're using FORMS on each page, continue passing the values through: <input type='hidden' name='harderQuestions' value='Yes'> This can be created through an "if" statement in PHP...
thanks! But can I also pass a numerical array in this way?
Yes, I have figured out how to do this: foreach ($myarray as $thisnum){ echo '<input type = "hidden" name = "topass[]" value = "'.$thisnum.'">'; } And to retrieve the array, $_POST['topass']
As to session, I'll try that later~ Thank you all.