Page 1 of 1

Post without losing data using PHP (Easy question)

Posted: Fri Aug 06, 2010 11:24 am
by grecci
Hi,


I am trying to build a page that will span 2 question with drop down menu (yes or no), the condition is if 1 of those question is yes per say then, a third question should appear right below on the same page without losing the previous questions/info. What would be the best to do that while using HTML and PHP? Thanks.

Re: Post without losing data using PHP (Easy question)

Posted: Fri Aug 06, 2010 2:30 pm
by bibumathew
The best way should be using an ajax

Re: Post without losing data using PHP (Easy question)

Posted: Fri Aug 06, 2010 2:36 pm
by internet-solution
bibumathew wrote:The best way should be using an ajax
Agree.

This can also be achieved the same with only PHP. It will not be as elegant as Ajax solution, but will do the trick.

Put the first two questions on page1.php in a form. Then post form values to page2.php where the first two questions will be shown along with answers populated from $_POST variables and third question will be shown or not depending on answers to first two questions.