Here you go:
--------------------------------------
REBOL [
    Title: "Preprocessing counter"
    Date:  24-May-2000
    Purpose: {Reads an HTML document replacing ~counter with the
        contents of the counter.txt file, incrementing it in the
        process.  Meant to be ran as a CGI.}
]

page: copy read %index.html

save %counter.txt counter: (load %counter.txt) + 1

replace page "~counter" counter

prin "Content-type text/html^(0A)^(0A)"
print page

------------------------------

Enjoy!  --Ryan

[EMAIL PROTECTED] wrote:

> Yes, please send it.  And thanks!
>
> Louis
>
> At 11:01 AM 5/24/00 -0700, you wrote:
> >You probably wont need it, but I now have source for that available on
> >request.
> >
> >[EMAIL PROTECTED] wrote:
> >
> > > I love the inline frame tag, but unfortuneately its not well supported
> > yet. That makes
> > > it a bad counter since you would only count those browsers that support it.
> > >
> > > After viewing your counter I got an idea you might like.  You can have
> > your REBOL
> > > counter preprocess your web page--much like the way PHP or SSI
> > does.  Have it parse
> > > your web page looking for a special text like ~counter.  Once this text
> > is found it
> > > would replace it with the actual count.  This way would let you use
> > your favorite html
> > > editor to create and edit the page, and still have an easy to create
> > program.
> > >
> > > You could also use tags like <REBOL-counter>, just 12345, or whatever
> > sequence you
> > > feel appropriate. This could be useful for doing quotes of the day,
> > random jokes, time
> > > and date, and all that other fun stuff.
> > >
> > > This would only add about 3 or 4 more lines to your existing counter
> > script. Hint: use
> > > the replace function.  You will also need to tell the webserver that
> > your printing
> > > html by first printing "Content-type: text/html^(0A)^(0A)".
> > >
> > > Best of all, it would count everytime.
> > >
> > > --Ryan

Reply via email to