<body onload='window.setInterval("timeHere()", 100)' onunload="sayTime()">
</body>
</html>
here is java script
<script>
var time=1;
function timeHere() {
time = time + 1;
finalTime = time / 10;
}
function sayTime() {
finalTime = time / 10;
//return finalTime;
alert("Thank you for coming to my site! \n You have been here " + finalTime + " seconds!");
}
</script>
How to save finalTime in php variable like $time??