Ok ive been trying to find the best solution for passing variables from one page to another all day.
Ive seen the use of hidden fields being implented with a while loop in php. I have gotten this to work but it seems like a lot of extra code being generated.
Is this the best way to do it? Or can i use a $_REQUEST to get them?
The reason i ask is because i have a couple large forms that need to be validated. The form uses the POST method and sends the variables to another page to be validated and displayed so the user can double-check if all is correct.
Then i need the variables to be passed to a terms/conditions page and held there kinda in limbo until the agree box is checked and the account is created by posting them to a MySQL DB.
What is the best way to accomplish this?
Should i have the form post to itself for validation then onto to terms page so im only passing them to one additional page?
Or is there a way to post the variables to the DB after validation and then if the terms are agreed upon delete them back out?
Any suggestions would be greatly appreciated?
Been searching all day could someone help with forms plz?
Moderator: General Moderators
They will all be accessable via the $_POST array, which is how you should access them. Using $_REQUEST or extract or a foreach($_POST AS $k=>$v){} yeilds security issues.
You can design the form multi-page or single page, but you don't need to store them in a database. Sessions would suffice for storage in this situation.
You can design the form multi-page or single page, but you don't need to store them in a database. Sessions would suffice for storage in this situation.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA