Computing.Net > Forums > Database > saving information to database

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

saving information to database

Reply to Message Icon

Name: jimy1200
Date: May 24, 2007 at 12:29:58 Pacific
OS: XP
CPU/Ram: 412
Product: intel
Comment:

Hi All,
Is there anyway to save users' information in a database when a user closes x button form the browser.
I have a logout button that takes care it only if they click log out button. But if the click x button in browser how do I save all the information. I am using php.
Any help will be geatly appreciated.

Thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: May 26, 2007 at 07:05:00 Pacific
Reply:

I believe that it will take a lot of work. I did a google on "window close event" and found the following page: http://www.dotnetjunkies.com/WebLog...

Basically it says there is no "window close event" but gives another suggestion.

Also, you have the problem that catching this event (pushing the X button) is handled by javascript, which is on the client (the user's PC) but the saving info to the database needs to be done on the server. You'll have to make the javascript that is called do a 'submit' to get the info to the server so that it can be saved.

But I guess that you understand that part, since you have a logout button. So the key is to catching the 'beforeunload' event mentioned. Note that this still doesn't cover all possibilities.



0

Response Number 2
Name: Razor2.3
Date: May 26, 2007 at 20:29:59 Pacific
Reply:

Are you talking about a web application? If so, you'll have to do your updating in the session close (if you're using ASP or JSP), which will happen around half an hour after the last page was pulled up (depending on the server settings). Obviously, any data not submitted before the browser is closed will not be saved.

You can try the onUnload JavaScript event, but there's no guarantee that the event will fire; JS could be disabled, or a security setting could block it.


0

Response Number 3
Name: Jennifer SUMN
Date: May 30, 2007 at 15:35:30 Pacific
Reply:

Right. It's not clear where the users are entering this information. Web-based application? Access Database? SQL? Some other?

Life's more painless for the brainless.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: saving information to database

Add records to .dbf database thru MS Access www.computing.net/answers/dbase/add-records-to-dbf-database-thru-ms-access/605.html

Data Extraction www.computing.net/answers/dbase/data-extraction/74.html

converting od database www.computing.net/answers/dbase/converting-od-database/123.html