Re: Applescript CGI Counter
Re: Applescript CGI Counter
- Subject: Re: Applescript CGI Counter
- From: Jeffrey W Baumann <email@hidden>
- Date: Sat, 14 Apr 2001 21:22:44 -0500
On Saturday, April 14, 2001, at 11:22 AM, Michelle Steiner wrote with
justifiable frustration:
I've seen methods where there's a simple line in the HTML code (like
what
Ted Wood showed in his reply) that merely inserts text into the a line,
without having to assemble the page in parts; that's all that I'm trying
to do.
I can't believe that it has to be as complex as some of the responses
I've been getting make it out to be.
Ok, here are the simple options:
1) Server Side Include (SSI) - Personal Web Sharing does not support
this; WebSTAR does. With WebSTAR the syntax (placed within the HTML) is
very simple:
<!-- #counter var="counterVariableName" display="true" -->
BUT (and it's a big but), it works only with static pages, NOT pages
generated by a CGI.
2) Applescript CGI (because this is the Applescript list, therefore
there is no other way to write a CGI : )
a) Use a property in the script which is incremented by the CGI
each time it runs, and which is included in the returned HTML.
Cons: if you recompile your script the counter is reset. Of course,
you can reset it to the last value it showed.
b) Have the CGI read the counter value from a text file, increment
it, and write it back. Display the value in the HTML your CGI returns,
Cons: None, really. You just need to know how to write a CGI. Since
you are new to CGIs, I'll give specifics in a separate (on list) email
(or I should finally make the instructional web page I've been meaning
to).
CGI in a nutshell - click the submit button on a web page with a form,
and the browser passes the form data to the server, which in turn passes
the form data to a program called a CGI. The CGI processes the data and
returns a complete HTTP response (HTTP headers + HTML) to the server,
which passes this reponse to the browser, which displays the HTML just
as if it was a static page.
Jeff Baumann
email@hidden/email@hidden (dual citizenship!)
www.linkedresources.com