[Tutor] Re: Hit Counter
Charlie Clark <email@example.com>
Thu, 02 Aug 2001 20:53:46 +0200
>Thanks for the responses so far. I've made some changes, but
>so far haven't resolved the problem. I've added the line
>to my Web page, which by the looks of it, should execute the
>script each time I load the Web page. It's only running when
>I the script page. Can anybody see why this is?
This won't work. You can't get a web page to do any work as HTML doesn't have
<!-- whatever you want --> is just a comment in HTML which means it *won't*
be interpreted by anything at all!
You've got two choices: either turn the page itself into a script (save it as
.cgi and in the appropriate directory) in which case it will call other
scripts *or* call the script via a trick such as <img src = "/cgi-bin/
counter.py">. The general advice is against ".pyw" as this won't necessarily
work if you move the script to another computer.
Is your webserver configured to run Python files? Does "/cgi-bin/counter.pyw"
work in your browser?