Hi Andrew,
just a thought of mine:
You seem to be capable of writing PHP code, your server is capable of processing it. So why don´t you create a .PHP file???
PHP is an embedded scripting language, this means you can place it everywhere in your HTML. When the PHP-Parser finds a php-tag it produces the output and inserts it into your already prewritten HTML.
So don´t worry about SHTML or dirty workarounds.
Your counter call could look like this:
[Your HTML]
<P>Hi, you are visitor number <?php (your counter code here!) ?> on our website....
[Your HTML again]
The only thing to keep in mind is to rename the page then into something like mypage.php or .php3 (depends on your server settings).
Why make it harder than it is??!!
Regards
FAB