what exactly is happening when PHP is putting contents (1 MB for example) in a file and the user closes the tab?
Could the file be corrupted? How can I avoid that?
Thanks a lot
what exactly is happening when PHP is putting contents (1 MB for example) in
Share
This is more a client-side issue…
I solved this problem using Javascript’s window.onbeforeunload and window.onunload functions:
In this case, I used to control variables: invalid_exit and submitted….
You can check if a user clicks a submit button(submitted=1), closes the browser(invalid_exit=0), refreshes the page(invalid_exit=0), etc… Depending on your requirement….
With Jquery you can control every event…
I hope this can help you out!!!