Re: applescript-users digest, Vol 2 #300 - 13 msgs
Re: applescript-users digest, Vol 2 #300 - 13 msgs
- Subject: Re: applescript-users digest, Vol 2 #300 - 13 msgs
- From: Richard 23 <email@hidden>
- Date: Tue, 30 Jan 2001 21:20:27 -0800
>
Calling all CGI Scripters...
>
>
I need help figuring out how to read the PATH_INFO variable hopefully
>
passed along with the WWWsdoc AppleEvent. It should contain everything
>
between the cgi script name and the '?' in the path. The only reference I
>
have is the "Using CGI" book. It explains the variable, but not how to
>
extract it using AppleScript. Here's an example of PATH_INFO:
>
>
http://www.server.com/calendar.cgi/2001/January?day=12
>
>
.... where " /2001/January " would be the captured variable data.
>
>
Does WWWsdoc handle this variable? I can extract the string following the
>
'$' and the '?' in the path, just not the PATH_INFO string.
>
>
Also, is there an alternative to using WWWsdoc? I find that its
>
implementation of using +class; specifiers to extract the variable data a
>
bit primative in the AppleScript way of doing things. Oh well, it works.
>
>
Thanks for any help you can provide.
Since Perl 5 is almost universally available server side and JavaScript
has an inside view with respect to windows and html forms and both support
easy code reuse I have had no need or desire to try and get AppleScript to
wear the CGI hat. I don't know where I would be able to make practical
use of it.
With server-side perl you have the %ENV hash array which you can iterate
to get the list of server environment variables. The ones I would use
on my server appear below.
DOCUMENT_ROOT /home/foo/HTML
HTTP_HOST www.apple.com
QUERY_STRING file=index.xml&global=1&env=1
* REQUEST_URI /cgi/readfile.cgi?file=index.xml&env=1
* SCRIPT_FILENAME /home/foo/HTML/cgi/readfile.cgi
* SCRIPT_NAME /cgi/readfile.cgi
>
http://www.server.com/calendar.cgi/2001/January?day=12
>
.... where " /2001/January " would be the captured variable data.
>
Does WWWsdoc handle this variable? I can extract the string following the
>
'$' and the '?' in the path, just not the PATH_INFO string.
the scripts I have written have always used either the query string (GET)
or POST (transparent to the perl programmer) but have never had anything
especially with forward slashes (looks like part of the path) between
the name of the script and the query string (after the ?). You're sure
you're not referring to DOCUMENT_ROOT above, the path from the server's
root to your working directory?
R23