Jump to content

question about multipage forms


Piba

Recommended Posts

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

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.