I have php script that counts web site visits. I need to call that script each time my html page loads.
How do I do that?
If it's a PHP page, you can include/require a page in to another PHP page using require or include see include and require documentation
require("counting_script.php");
// or
include("counting_script.php");
If it's a purely HTML file, then you could consider using an iFrame to load your other page see tutorial
<iframe src="page_counter.php"></iframe>
Or if you know jQuery, you could make an ajax call (using jQuery) to your counting page. See documentation
$.get('page_counter.php', function(data) {
alert('Counter page was called');
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With