Still got an error. I now have this code (post the whole scriptcode now):
Code:
...some html and other tags here...
<?php
for ($i=0; $i<sizeof($user->online); $i++)
{
echo <<<END
<script type="text/javascript">
var updateTimeout;
SET_DHTML(CURSOR_HAND, "'.$user->online[$i]['name'].'");
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
var xmlHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) { // IE
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
updateTimeout = setTimeout("checkPos()", 1000);
function my_DropFunc() {
xPos = dd.obj.x;
yPos = dd.obj.y;
xmlHttp.open('GET', 'xml.php?xpos='+xPos+'&ypos='+yPos+'&random='+Math.random(), false);
xmlHttp.send(null);
updateTimeout = setTimeout("checkPos()", 1000);
}
function my_DragFunc() {
clearTimeout(updateTimeout);
}
function checkPos() {
xmlHttp.open('GET', 'xml.php?random='+Math.random(), false);
xmlHttp.send(null);
response = xmlHttp.responseXML;
xPos = response.firstChild.getAttribute('xpos');
yPos = response.firstChild.getAttribute('ypos');
dd.elements.'.$user->online[$i]['name'].'.moveTo(xPos, yPos);
updateTimeout = setTimeout("checkPos()", 1000);
}
</script>
END;
}
?>
</body>
</html>
I get the error:
Parse error: parse error, unexpected $ in /test/page1.php on line 80
Line 80 = </html>
They've lost me here
Bookmarks