From: Merlin Morgenstern on
Hello everybody,

I have form where users enter data to be saved in a db.

How can I make php save the form data into a session before the user
leaves the page without pressing the submit button? Some members leave
the page and return afterwards wondering where their already entered
data is.

Any ideas how to save into php session data before someone leaves the page?

Thank you for any hint,

Merlin
From: Ashley Sheridan on
On Tue, 2010-04-13 at 15:20 +0200, Merlin Morgenstern wrote:

> Hello everybody,
>
> I have form where users enter data to be saved in a db.
>
> How can I make php save the form data into a session before the user
> leaves the page without pressing the submit button? Some members leave
> the page and return afterwards wondering where their already entered
> data is.
>
> Any ideas how to save into php session data before someone leaves the page?
>
> Thank you for any hint,
>
> Merlin
>


Session data is all stored on the server, so it requires a submit in
order for the server to actually get the data.

You could use Ajax to grab the form data and send it to the server if
you need though.

However, I'm not really sure what your question is. Are people visiting
your site, filling in a form, then pressing the back button to go
somewhere else? If so, maybe they intended to not submit the form.

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: Paul M Foster on
On Tue, Apr 13, 2010 at 03:20:23PM +0200, Merlin Morgenstern wrote:

> Hello everybody,
>
> I have form where users enter data to be saved in a db.
>
> How can I make php save the form data into a session before the user
> leaves the page without pressing the submit button? Some members leave
> the page and return afterwards wondering where their already entered
> data is.

I hate to be a contrarian (not really), but there is a paradigm for
using web forms. If you want the internet to save your data, you have to
press the little button. If you don't, then it won't be saved. Not hard
to figure out, not hard to do. If you have to go do something else while
you're in the middle of a form, open a new tab/window and do it. When
you come back to your original form, the data will still be there (but
again, not *saved* until you hit the little button).

Sorry, I just get cranky with people who won't follow the rules.

Paul

--
Paul M. Foster
From: tedd on
At 11:27 AM -0400 4/13/10, Paul M Foster wrote:
>On Tue, Apr 13, 2010 at 03:20:23PM +0200, Merlin Morgenstern wrote:
>
>> Hello everybody,
>>
>> I have form where users enter data to be saved in a db.
>>
>> How can I make php save the form data into a session before the user
>> leaves the page without pressing the submit button? Some members leave
>> the page and return afterwards wondering where their already entered
>> data is.
>
>I hate to be a contrarian (not really), but there is a paradigm for
>using web forms. If you want the internet to save your data, you have to
>press the little button. If you don't, then it won't be saved. Not hard
>to figure out, not hard to do. If you have to go do something else while
>you're in the middle of a form, open a new tab/window and do it. When
>you come back to your original form, the data will still be there (but
>again, not *saved* until you hit the little button).
>
>Sorry, I just get cranky with people who won't follow the rules.
>
>Paul

Paul:

What rules? I didn't see any rules. There are simply easy ways to do
things and those not so easy -- like jumping out the window or using
the stairs. You arrive at the same place, but at what cost?

In this case, I don't think the OP has provided us with enough
information about his problem.

If he is concerned that his users may return to a page and wants the
fields filled with what the user previously entered, then that
depends upon several different things, such as has the user shut down
his browser, or has the user simply clicked the submit button and the
page has been refreshed. IOW, how has the user left the page?

So, OP explain what you are trying to do?

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
From: Kevin Kinsey on
Paul M Foster wrote:
>
> Sorry, I just get cranky with people who won't follow the rules.
>

<?php

$pauls_post++;

?>