Piba Posted April 1, 2008 Share Posted April 1, 2008 Hello guys... I have a multipage form, let say the form consists of 4 pages In every page there are some questions and it should be saved before the user going to the next page There are also 4 tables of database, each page's data will be saved in one table.. So, when i saved the first page's data, i took the id and store it it session: $_SESSION['id']=$id; and in each page i took this session and insert the data according to that id...... My problem is: some times when the user close the form before ending it, the session will be store, and any user want to start the form, an error message tell him that you have already fill page 1 How can i handle this problem?? I wrote on the last page: unset_session but didn't solve my problem I think about forgetting this method and start by sending data by post (hidden input) But i faced alot of problem too :'( So...any suggestion?? Waiting your help Regards, Piba Quote Link to comment Share on other sites More sharing options...
ansarka Posted April 1, 2008 Share Posted April 1, 2008 when you close the browser your session will be destroyed automatically so you cannot track the user by session id if you have any registration you can use that unique user id to track this when a user with id=1 comes you can chk the 4 tables whether all entries are there for id=1 if id is only in table 1 you can say the user you hv filled table 1 continue to table 2 Quote Link to comment Share on other sites More sharing options...
Xil3 Posted April 1, 2008 Share Posted April 1, 2008 Hello guys... I have a multipage form, let say the form consists of 4 pages In every page there are some questions and it should be saved before the user going to the next page There are also 4 tables of database, each page's data will be saved in one table.. So, when i saved the first page's data, i took the id and store it it session: $_SESSION['id']=$id; and in each page i took this session and insert the data according to that id...... My problem is: some times when the user close the form before ending it, the session will be store, and any user want to start the form, an error message tell him that you have already fill page 1 How can i handle this problem?? I wrote on the last page: unset_session but didn't solve my problem I think about forgetting this method and start by sending data by post (hidden input) But i faced alot of problem too :'( So...any suggestion?? Waiting your help Regards, Piba You could change it so that it allows them to view pages that have already been filled out, and if they go back to those pages you could just pre-populate the data into the form fields (since they would have already filled it out)... Would that work for you? This way you won't get the errors coming up and it will be more user friendly as well. Quote Link to comment Share on other sites More sharing options...
Piba Posted April 2, 2008 Author Share Posted April 2, 2008 You could change it so that it allows them to view pages that have already been filled out, and if they go back to those pages you could just pre-populate the data into the form fields (since they would have already filled it out)... Would that work for you? This way you won't get the errors coming up and it will be more user friendly as well. mmmmmmmmm... I don't want them to go back to prevoiuse pages and modify them.. When the user try to do so, i check if he filled this page before, if so, an error message will appear.. The problem is when two users at the same time open the form, the sessions not work as well I think there is a conflict , i don't know why!!!!!!!!! maybe coz i'm using $_SESSION['id']=$id; session_write_close(); Is there any way other than what i did for storing the session?? Thanks Quote Link to comment 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.