Forum Moderators: open

Message Too Old, No Replies

how to execute a script when a user exits webpage

         

d40sithui

6:29 pm on Aug 16, 2007 (gmt 0)

10+ Year Member



hi guys,
can anyone tell me how to run a certain php script right after a user (a) closes the browser and (b) goes to a different webpage
thanks in advance

syktek

6:44 pm on Aug 16, 2007 (gmt 0)

10+ Year Member



you can use it in the body tag like so:
<body onunload="alert('goodbye');">

or as a function:


window.onunload = leavePage;

function leavePage() {
alert("goodbye");
}

d40sithui

11:14 am on Aug 17, 2007 (gmt 0)

10+ Year Member



hey thanks,