This one in particular seems promising, however, I am using a free account to host my site and am not allowed to use fopen. I am struggling to change the code to insert the variable to a MySQL database.
I would greatly appreciate an example of tracking the length of stay and storing it to a MySQL Database. (I know how to use PHP to insert to a DB, I do not know how to modify this code to meet my needs.)
Attached is the JS in an HTML file which uses the posted PHP code.
//write your own handling code here, store it in a file or store it in a DB, whatever
$logfilename = timelog.txt;
if (!$handle = fopen($logfilename, a))
if (fwrite($handle, $timemsg.\r\n) === FALSE)