Hi everyone:
I'm building a site that will take a lot of user input to build up the data in a database.
I want to build the forms so that form_2, for example, will change its available inputs depending upon what a user selected in form_1.
Is there a best way to do this? My original vision of this was to have a "data_collection_01.php" page, then a "data_collection_02.php" page, etc., where each successive page collects data from some or all of the previous pages and displays form elements based upon those collected variables. For example, form_01 might ask "How many chapters are there in the book?" and then form_02 would use that number to display the correct number of text boxes--one per chapter.
I had posted a different question earlier this week that Shrike and mtimdog helped me figure out. One of Shrike's responses to my question essentially took everything I was doing in three different pages and put all that functionality into a single page. Much, much cleaner code. Far more efficient than what I had initially envisioned.
I've started developing the entire data entry process using the same methodology suggested by Shrike, but I can see how this is going to lead to some VERY long pages of code.
Is this just a matter of style? Is there a best practices way to approach this? I'm brand spankin' new to PHP and programming in general, and, rather than make a mess of things up front, I'd like to approach this project using the best possible development methodologies.
Thanks,
--Vince