It's an ajax update to update a database to say a user is still online.
I want to pass in a userID
ajax.js
// JavaScript Document
function UpdateUserOnline(str, ID, UnixTime, Name){
if (str==""){
document.getElementById("txtHint").innerHTML="";
return;
}
if (window.XMLHttpRequest){
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
} else {
// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","z.php?ID=" + ID, true);
xmlhttp.send();
}
index.php
<script type="text/javascript" src="ajax.js"></script>
<script type="text/javascript">
var interval_token = setInterval("UpdateUserOnline()", 6*1000);
</script>
page z.php just emails so i know it's working, it would be update_table.php and update my database table when working.
The issue is I can't pass variables into UpdateUserOnline class when it's in the SetInterval thingie