If you have access to PHP, but just not for this page, then you can make a
call in an IFrame, or a hidden frame.
Basically, you would do something like this on the calling page via
JavaScript:
<script>
document.getElementById("myframe").src =
"http://myserver/mydirectories/pagecounter.php?Page=thispage.htm";
</script>
Then, on the pagecounter.php page (or whatever you decide to name it), you
can run whatever PHP code you need, and return a value via Javascript to the
calling page: So, something like so:
<?php
NewCount = getPageCount() + 1;
//where the getPageCount() function handles your counting routines
?>
<script>
window.parent.document.getElementById("targetSpan").innerHTML = <?php
echo(NewCount); ?>;
</script>
That's off the top of my head, so may need some tweaking.
Just had a thought for another method... using cookies via JavaScript. But
no, I guess that would only do a user specific counter...
Another option is to just run the .html files through the php interpreter
and embed php code, if you have control of the server. This means that you
can appear to the public as being a static page, but actually be dynamic.
It's relatively easy to configure Apache to do this, though I'd have to look
it up again...
Hope this gives you a few leads...
Shawn
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Jon Copeland
Sent: Wednesday, April 14, 2004 8:34 PM
To: CLUG General
Subject: [clug-talk] COMPLETELY NON LINUX RELATED: HTML Counter
Does anyone know of any code which I can input into an .html page which
will count hits? I know this is possible with Szemirs PHP Counter but
the problem is I cannot rename this file to have a .php extension, it
*must* have an .htm* extension.
Does anyone know how to code anything like this?
Ty
J
_______________________________________________
clug-talk mailing list
[EMAIL PROTECTED]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
_______________________________________________
clug-talk mailing list
[EMAIL PROTECTED]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca