Post without losing data using PHP (Easy question)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
grecci
Forum Newbie
Posts: 1
Joined: Fri Aug 06, 2010 11:17 am

Post without losing data using PHP (Easy question)

Post 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.
bibumathew
Forum Newbie
Posts: 8
Joined: Tue Aug 03, 2010 5:36 pm

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

Post by bibumathew »

The best way should be using an ajax
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

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

Post 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.
Post Reply