[Tutor] Re: Hit Counter

Charlie Clark Charlie Clark <charlie@begeistert.org>
Thu, 02 Aug 2001 22:19:19 +0200


>| Most all web servers in the last ten years have been able to handle
>| Server-Side Includes (SSIs), IF activated in the server.  It all depends
>| on what the server allows.   
Be that as it may I think we're getting a little off track with the original 
question.

>I haven't really used SSI, but I thought the syntax was more like the
>C preprocessor :
>
>#include <otherfile.html>
yep. But what's the point? The counter does nothing else than duplicate the 
log file. A really crude hit counter would simply count how many lines are in 
the log file!

>I could be way off though since it has been a while since I read
>anything on SSI.
>
>| Zope is not the web, it is one application server on the web, and
>| there are more books out there describing (in part) SSIs than Zope
>| and DTML.
>
>Right, but that syntax (commands, etc, embedded in comments) looks
>familiar from having looked over Zope docs.  :-)
This is true. Zope's DTML uses this notation - it's useful because it doesn't 
show up in a preview and most HTML editors leave it alone. Other embedded 
scripting approaches use something similar where the directives ar embedded 
in the comments. The server knows when to pass a file to an engine by the 
file extension (phtml, shtl, asp, jsp, php, psp, cfm, stm, dtml) and the 
engine interprets (and removes= the directives embedded in the comments. But 
this never happens for plain HTML files and Jon's post seemed to want a line 
that could be added to each web page ie. .html and of course the python 
involved.

"exec" can only be used inside a python script, so it won't work here. For 
reaons which others are much better at explaining it is to be used with 
caution!

The web-counter could work as a server side include. Jon, does your server 
support SSI? Do you have it running? If not either an embedded scripting 
language is necessary or an object in the page will have to call the script. 
Using an image to do this is about the best way of making sure it works.

Charlie
-- 
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-463-6199
http://www.begeistert.org