I am trying to split up the registration form into two php pages. Is it possible for the second page to submit its form along with the $_post which contains the information from the first page? well the question should be.. is there a function in php which will bind the $_post variable to the current form submit method?

The other ways to get this working are the hidden fields, sessions, cookies. Can i do without these?

page1.php (submit)-> page2.php (submit the form along with $_post/$_get) -> page3.php (where i'll do database manipulations.)

Recommended Answers

All 2 Replies

Is it possible for the second page to submit its form along with the $_post which contains the information from the first page?

No. as soon as page2 completes execution (basically once it loads in your browser) the current page variables cease to exist. The only reason why the data is maintained across visits is because the browser and the server send a cookie back and forth that identifies a unique file on the server where the $_SESSION info for that particular user is stored.

The other ways to get this working are the hidden fields, sessions, cookies. Can i do without these?

No.

But the approach you described above is server-side. What you can do is to show one form at a time on the browser but do not submit the form right away. Instead, you show form 1 then go "Next" and the current form will hide and the other set of fields will appear. Then "Next", etc. Finally, when the user clicks finish, THEN you actually submit to the server. Ultimately (if you do things right) you will do ONE submission to the server.

http://www.jankoatwarpspeed.com/post/2009/09/28/webform-wizard-jquery.aspx
http://thecodemine.org/

kk... :) and thanks for the links.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.