Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Php Timer

Status
Not open for further replies.

loveccb

Programmer
Dec 9, 2005
4
US
Hello all,

I'm trying the do the following:

I have a 2 page application. When the user completes the 1st page and hits submit the information is submitted to a database and they are brought to page 2 where the setup is similar.

This is what I'd like to do: If the user completes the first page but doesn't fill out the 2nd page(closes brower, navigates away, etc) I want to send an email to them(they provided this on the first page). How to accomplish this? I know not. If the user closes the brower and leaves the page or closes the brower how will I know this? My next thought was maybe using a timer, but I think that by closing the brower, the timer idea won't work. My next thought was running some script on the backend (every hour or so) that scans the database looking for page 2 applications that haven't been filled out.

Am I looking down the wrong path? Is there a simple way to do this?

Thanks!
 
There is no deterministic way to know when the browser is shut down or goes to another site. You can do some browser-specific IE stuff, maybe.

When the user submits the first page of information, make sure a record is created in whatever database you are using. Have an application scan your database periodically, emailing all users that have only partial records in the database.

The scan-and-email script could even include garbage-collection. When it finds a partial record and emails the user, the script could also add an annotation to the record, staying that the email has been sent. If the record is still there after a certain period of time (or after a certain number of times emailing reminders), the next pass of the scan-and-email script deletes the record.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks for the reponse sleipnir214. That's where I was headed, but I figured there might be a way I wasn't seeing. Much appreciated!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top