Re: CGI?
Re: CGI?
- Subject: Re: CGI?
- From: Jed Verity <email@hidden>
- Date: Fri, 13 Apr 2001 14:15:11 -0700
Let me see if I can distill all of this:
In order for an AppleScript CGI to be successfully triggered from a web
page, it must be saved as a stay-open application and placed somewhere in
the web directory (or in the cgi-bin folder, if specified by your webserving
software). The name of this stay-open applet should be terminated with
".acgi".
The final result of of the CGI should be an HTML page that is constructed
within the script. A simple example:
on handle_cgi_request
--do stuff
return "<HTML>Returned from CGI</HTML>"
end handle_cgi_request
This page is displayed in the browser upon completion of the CGI script. It
could show results of the script, errors, a "thank you for...", a <meta
http-equiv> to redirect the browser, or anything else you want!
Typically, though, your HTML page is not going to be as simple as the
example above and you'll need to include content types, carriage-return
line-feed characters, version info, etc. So, most scripters will define the
properties as Cris has below and then piece together all of the sections in
the final result.
Not sure that helps...
Jed
On 4/13/01 1:05 PM, you wanted me to know this:
>
On 4/13/01 11:13 AM, cris <email@hidden> wrote:
>
>
>>> At the end of the handler you have to return back something to the
>
webserver
>
>>> (which will pass it to the browser). You need to specify the type of
>
>>> response in the header. In this case it will be a '200 OK' which looks so:
>
>>>
>
>>> property CRLF : (ASCII character 13) & (ASCII character 10)
>
>>> property http_OK_header : "HTTP/1.0 200 OK" & CRLF & "Server: MacHTTP" &
>
>>> CRLF & "MIME-Version: 1.0" & CRLF & "Content-type: text/html" & CRLF & CRLF
>
>>
>
>> This goes in the header of the HTML page?
>
> Yes, the HTML page created within your CGI, passed to the webserver which
>
> will send it to the browser.
>
>
I think I understood up to here, and after it, but what HTML page created
>
within my CGI?
>
>
Is the CGI the Applescript?
>
>
It's just not making sense to me at all.
>
>
--Michelle
>
>
----------------------------------------------------------------------
>
| Michelle Steiner | We're not human beings having a spiritual |
>
| | experience. We're spiritual beings |
>
| email@hidden | having a human experience. |
>
----------------------------------------------------------------------
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
~)~)~)~)~)~)~)~)~)~)~)~)~)
Jed Verity
References: | |
| >Re: CGI? (From: Michelle Steiner <email@hidden>) |