Can't get dumb webcounter working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J. W. McCall

    Can't get dumb webcounter working

    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

  • Tyler Eaves

    #2
    Re: Can't get dumb webcounter working

    On Sun, 03 Aug 2003 04:08:18 +0000, J. W. McCall wrote:
    [color=blue]
    > 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[/color]

    Server side includes?




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

    Comment

    • Barry Sprajc

      #3
      Re: Can't get dumb webcounter working

      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%Wa.1483 98$xg5.51882@tw ister.austin.rr .com...[color=blue]
      > 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
      >[/color]


      Comment

      • J. W. McCall

        #4
        Re: Can't get dumb webcounter working

        Barry Sprajc wrote:
        [color=blue]
        > 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.[/color]

        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

        Comment

        • Brian Victor

          #5
          Re: Can't get dumb webcounter working

          J. W. McCall wrote:[color=blue]
          > 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.[/color]

          You're close, but you're missing a few characters:


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

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

          --
          Brian

          Comment

          • Jane Doe

            #6
            Re: Can't get dumb webcounter working

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

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

            Founded in 1997, DEVShed is the perfect place for web developers to learn, share their work, and build upon the ideas of others.


            JD.

            Comment

            Working...