Hi Petran,
Ah, what's happening is that when you go to a form page, the API sets up sessions for that individual form. When you go to the NEXT form, the sessions are still remembered from the last one, and cause the problem you mentioned.
Interesting this problem hasn't been brought up before, actually...
What you need to do is empty the sessions cache when flipping between forms. I'd probably do it like this. Right after the require("/path/to/api.php"); line in each of your forms add this:
That checks to see if the form ID in memory is different from the current form, and if so, empties it. (Weirdly, the ft_api_init_form_page(X) function call is needed here: the ft_api_clear_sessions() function needs it to have been called beforehand. I plan on fixing this at some point).
After that, you'll already have your own ft_api_init_form_page() function (already in your form), which will re-initiate sessions - and everything should work smoothly.
I confess, I haven't tested this, but it should work fine... knock on wood.
- Ben
Ah, what's happening is that when you go to a form page, the API sets up sessions for that individual form. When you go to the NEXT form, the sessions are still remembered from the last one, and cause the problem you mentioned.
Interesting this problem hasn't been brought up before, actually...
What you need to do is empty the sessions cache when flipping between forms. I'd probably do it like this. Right after the require("/path/to/api.php"); line in each of your forms add this:
PHP Code:
// X should be the form ID of your form on each page
if (isset($_SESSION["form_tools_form"]["form_tools_form_id"]) && $_SESSION["form_tools_form"]["form_tools_form_id"] != X) {
ft_api_init_form_page(X);
ft_api_clear_sessions();
}
That checks to see if the form ID in memory is different from the current form, and if so, empties it. (Weirdly, the ft_api_init_form_page(X) function call is needed here: the ft_api_clear_sessions() function needs it to have been called beforehand. I plan on fixing this at some point).
After that, you'll already have your own ft_api_init_form_page() function (already in your form), which will re-initiate sessions - and everything should work smoothly.
I confess, I haven't tested this, but it should work fine... knock on wood.
- Ben