Posted: Fri Jun 06, 2003 5:40 pm
I've got a question on using JS with PHP.
I've made a simple counter using PHP and MySQL.
Now I need to be able to use it with a html page using JavaScript. I have tried everything I can think of, but maybe someone could help me out with this.
Here is what the html page looks like:
And here is what the PHP code looks like:
Does anyone know how I can get the hit value displayed on the HTML page using JavaScript?
I've made a simple counter using PHP and MySQL.
Now I need to be able to use it with a html page using JavaScript. I have tried everything I can think of, but maybe someone could help me out with this.
Here is what the html page looks like:
Code: Select all
<!-- File: test.html -->
<html>
<head><title>Test counter</title></head>
<body>
<script src="index.php?page=count&id=1" language="JavaScript">
</script>
</body>
</html>Code: Select all
echo "<script>
<!--
document.write("Hits: ".$hits."<br />");
//-->
</script>\n";