By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,627 Members | 2,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,627 IT Pros & Developers. It's quick & easy.

Can't get dumb webcounter working

P: n/a
Sorry if this is OT, but here's my question:

I wrote a simple python script to increment a counter in a text file,
and I wanted this script to be accessed whenever an HTML file is
accessed. The HTML files and python script are on a shell account on
UNIX a machine that has support for CGI, Python, etc. I unfortunately
don't know much about CGI, since I assume this is what I need to get
this to work. All I want to do is to get script to be called when the
web site is accessed and hopefully insert some output (a number) into
the HTML.

Any advice, specific instructions, pointers to helpful web resources, or
recommendations to better newsgroups, if this is too OT here, would be
greatly appreciated.

Thanks,

J. W. McCall

Jul 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Sun, 03 Aug 2003 04:08:18 +0000, J. W. McCall wrote:
Sorry if this is OT, but here's my question:

I wrote a simple python script to increment a counter in a text file,
and I wanted this script to be accessed whenever an HTML file is
accessed. The HTML files and python script are on a shell account on
UNIX a machine that has support for CGI, Python, etc. I unfortunately
don't know much about CGI, since I assume this is what I need to get
this to work. All I want to do is to get script to be called when the
web site is accessed and hopefully insert some output (a number) into
the HTML.

Any advice, specific instructions, pointers to helpful web resources, or
recommendations to better newsgroups, if this is too OT here, would be
greatly appreciated.

Thanks,

J. W. McCall


Server side includes?


--
Visit my blog - http://blog.scalegen.com
Music, Programming, and More.

Jul 18 '05 #2

P: n/a
Tyler's correct.

You'll want to check with those hosting your web site, they usually have
particular directories in your home directory where you'll put your scripts,
etc...

Then, you just need to put the correct HTML code in your document.

/barry sprajc

"J. W. McCall" <no@spam.com> wrote in message
news:SU********************@twister.austin.rr.com. ..
Sorry if this is OT, but here's my question:

I wrote a simple python script to increment a counter in a text file,
and I wanted this script to be accessed whenever an HTML file is
accessed. The HTML files and python script are on a shell account on
UNIX a machine that has support for CGI, Python, etc. I unfortunately
don't know much about CGI, since I assume this is what I need to get
this to work. All I want to do is to get script to be called when the
web site is accessed and hopefully insert some output (a number) into
the HTML.

Any advice, specific instructions, pointers to helpful web resources, or
recommendations to better newsgroups, if this is too OT here, would be
greatly appreciated.

Thanks,

J. W. McCall

Jul 18 '05 #3

P: n/a
Barry Sprajc wrote:
Tyler's correct.

You'll want to check with those hosting your web site, they usually have
particular directories in your home directory where you'll put your scripts,
etc...

Then, you just need to put the correct HTML code in your document.


From the FAQs and help at my shell account (freeshell.org) it says I
don't need a "cgi-bin" directory or anything like that; I can run
scripts from anywhere.

As far as the correct HTML code...sorry if this is a dumb question, but
what exactly would that HTML code be? I saw something about "<!--
exec"command here" -->" but that didn't seem to work. I've never called
a script from an HTML document. I guess that's what I'm trying to
figure out.

Thanks,

J. W. McCall

Jul 18 '05 #4

P: n/a
J. W. McCall wrote:
As far as the correct HTML code...sorry if this is a dumb question, but
what exactly would that HTML code be? I saw something about "<!--
exec"command here" -->" but that didn't seem to work. I've never called
a script from an HTML document. I guess that's what I'm trying to
figure out.


You're close, but you're missing a few characters:
http://httpd.apache.org/docs-2.0/mod...l#element.exec

<!--#exec cgi="yourscript.py"-->

Or similarly the "include virtual" alternative mentioned at the link
above.

--
Brian
Jul 18 '05 #5

P: n/a
On Sun, 03 Aug 2003 04:08:18 GMT, "J. W. McCall" <no@spam.com> wrote:
Any advice, specific instructions, pointers to helpful web resources, or
recommendations to better newsgroups, if this is too OT here, would be
greatly appreciated.


More infos on calling a Python script through a URL (CGI call) here:

http://www.devshed.com/Server_Side/P...CGI/print_html

JD.
Jul 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.