GB_001 Posted January 11, 2008 Share Posted January 11, 2008 I was wondering if there is anyway to call a php function to change a variable one the user closes the page or tab? Thankyou for your help. -GB Link to comment https://forums.phpfreaks.com/topic/85574-changing-a-variable-when-window-is-closed/ Share on other sites More sharing options...
nikefido Posted January 11, 2008 Share Posted January 11, 2008 change a variable? they cease to exist when you close a page do you mean a static variable in a class or included file? Or a database record? ... I would use javascript, as it can do events when you close a window - this would be an ajax use (if you are trying to run a php script when the window closes). However, if you want some data stored that's not on a web page, you need to use a separate file (.txt file) or a database... What are you trying to accomplish? Link to comment https://forums.phpfreaks.com/topic/85574-changing-a-variable-when-window-is-closed/#findComment-436703 Share on other sites More sharing options...
GB_001 Posted January 11, 2008 Author Share Posted January 11, 2008 I was storing the variable in a database, what I was trying to accomplish was solving a problem in my chat script for when the user closes the window the chat databases inactivity var in the database goes to one. Link to comment https://forums.phpfreaks.com/topic/85574-changing-a-variable-when-window-is-closed/#findComment-436714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.