Welcome Guest, Not a member yet? Register   Sign In
Tansfer variable between views
#15

[eluser]Kromack[/eluser]
So,

I think it should gone like this :

When the user have completed one step, you put all data in your table with :

- The session id
- The id of the step
- All datas
- the current timestamp (see the time() function or the date helper)

Then, when a step is validate, you have to check if the user have completed all precedent steps (use the the session id to find your user).

By using this method, if the session of an user expire, the session id will mismatch. So he have to redo all steps.

The next problem is to purge your table (in fact to remove all row with a session id expired).

You can create in your controller a function :

Code:
public function purge() {

//Get current timestamp
//Calculate the timestamp offset (now - X seconds)
//foreach row
////calculate the offset of the row (stored timestamp + x seconds)
////if((stored timestamp + x seconds) <= (now - X seconds))
////then delete the row
////endif
//endforeach


}


Ok, in France it is the morning, so I'm a little like this : :long:

If you have any problem, you can ask Wink

Good luck


Messages In This Thread
Tansfer variable between views - by El Forum - 05-06-2008, 02:11 AM
Tansfer variable between views - by El Forum - 05-06-2008, 02:18 AM
Tansfer variable between views - by El Forum - 05-06-2008, 02:20 AM
Tansfer variable between views - by El Forum - 05-06-2008, 02:25 AM
Tansfer variable between views - by El Forum - 05-06-2008, 02:27 AM
Tansfer variable between views - by El Forum - 05-06-2008, 02:36 AM
Tansfer variable between views - by El Forum - 05-06-2008, 03:00 AM
Tansfer variable between views - by El Forum - 05-06-2008, 03:01 AM
Tansfer variable between views - by El Forum - 05-06-2008, 03:08 AM
Tansfer variable between views - by El Forum - 05-06-2008, 07:42 AM
Tansfer variable between views - by El Forum - 05-06-2008, 08:04 AM
Tansfer variable between views - by El Forum - 05-06-2008, 08:08 AM
Tansfer variable between views - by El Forum - 05-06-2008, 08:10 AM
Tansfer variable between views - by El Forum - 05-06-2008, 09:08 AM
Tansfer variable between views - by El Forum - 05-07-2008, 02:24 AM
Tansfer variable between views - by El Forum - 05-07-2008, 02:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB