lead2gold Posted July 28, 2006 Share Posted July 28, 2006 Hi guys,I just got a general question...I have a form that will have many display lists that you add/remove to using <input type="button">Step 1:I want to be able to populate many fields with potentionally many resubmits to the same form as information gets added/removed.Step 2:Finally once everything is set up the way one might want, they can hit the big save button at the bottom which will process all the information they entered and insert it into the database.Now, generally a normal form only consists of Step 2.... do your error checking; if all is good, then preform the DB insert.But the form i need to build will have many little [add] buttons everywhere that will keep small amounts of information to a table (i will store as an array).I was thinking.... would it be safe/ok to just save everything to $_SESSION. And when the final Save is pressed, i just parse through the $_SESSION and preform my inserts?Here is a sample of a form i did up quickly in an image editor of what i intend to make:[img]http://rideaubuslines.lead2gold.org/deleteme/route-a.JPG[/img] Quote Link to comment https://forums.phpfreaks.com/topic/15909-sessions-and-forms/ Share on other sites More sharing options...
Ninjakreborn Posted July 28, 2006 Share Posted July 28, 2006 That looks like it would be safe, just don't specify a time in the php.ini and if defaults to when the browser closes. So you just close the browser after your done to kill the session, if you specify a time, then 2 things can happen.1. it can delete your sessions before you are even finished with what you are doing.2. if it's set too high it can make it to where if there is a lot of time left over after you close the browser someone could hijack the sessiona nd finish doing what you started, or work on what you were working on, leaving it to default makes it clear as soon as you close the browser. Other than that it should be safe. Quote Link to comment https://forums.phpfreaks.com/topic/15909-sessions-and-forms/#findComment-65298 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.