Event on close window

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Zoram
Forum Contributor
Posts: 166
Joined: Sun Aug 18, 2002 3:28 pm
Location: Utah
Contact:

Event on close window

Post by Zoram »

I've heard that there is a way in ColdFusion to run a script / do something when the user closes the browser window. Is there a way that i can execute a script when a window is closed with php??
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

no.

thats what javascript was made for.
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

javaScript

Post by phpScott »

Because php is server side and has no idea what is going on with the client you would need to use a client side language like JavaScript which I believe has a window.close event.

phpScott
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

or the html onUnload event

<body onUnload="alert('bye');">
Post Reply