Try the window.open method to popup a php page that does the desired job.

<script>
window.onunload=doRec
function doRec() {
    window.open("writeToDB.php")
}
</script>

and writeToDb.php
<?php
//......
?><script>window.close()
</script>

--
Regards,
Ns_Andy, [EMAIL PROTECTED]
"Edward Peloke" <[EMAIL PROTECTED]> wrote in message 
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> I need a way to write a record to the db when the user closes their browser.
> How can I do this?  I looked last night at the onunload javascript event but
> am not sure how that can trigger the php code to enter a row in the db.  I
> am using sessions so is there a way to write to the db when the session is
> deleted?
>
> Thanks,
> Eddie
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to