I have this variable -time-, which calculates the time spent at a page.
I would like to send this to a PHP file. How can i do this?
That´s what i have done:
<html>
<head>
<script language=javascript type="text/javascript">
var min1,min2;
function tempoEntrada(){
now = new Date
min1 = now.getMinutes(); // 0-59
seg1 = now.getSeconds();
}
function tempoSaida(){
now = new Date
var min2 = now.getMinutes(); // 0-59
var seg2 = now.getSeconds();
min=min2-min1;
seg=seg2-seg1;
time=min+':'+seg;
</script>
</head>
<body onload="tempoEntrada()">
<form>
<input type="button" onclick="tempoSaida()" value="here">
</form>
Thanks!