Re: WWW?sdoc - how do I read PATH_INFO variable?
Re: WWW?sdoc - how do I read PATH_INFO variable?
- Subject: Re: WWW?sdoc - how do I read PATH_INFO variable?
- From: email@hidden
- Date: Tue, 30 Jan 2001 12:05:11 EST
Ted,
Once again, rethink running CGIs on 68030 Macs, unless they are exceedingly
simple. They will be painfully slow, and, as you have observed, have clumsy
syntax.
In MacOS 8.5 or thereabouts, Apple introduced the osax "Handle CGI request"
with the following syntax (watch those continuation characters):
on handle CGI request URL_path ,
searching for searching_for ,
with posted data posted_data ,
of content type content_type ,
using access method access_method ,
from address client_address ,
from user userName ,
using password password ,
with user info user_info ,
from server server_name ,
via port server_port ,
executing by script_name ,
referred by referred_by ,
from browser browser_name ,
using action action_used ,
of action type action_type ,
from client IP address client_IP_address ,
with full request full_request ,
with connection ID connection_ID
I believe the www sdoc event (that's an omega character - option-z -
following the www, for those who don't know) has almost identical parameters
(forgive the special characters which will doubtless appear horrid),
on +event WWW?sdoc; path_args given +class kfor;:http_search_args, +class
post;:post_args, +class meth;:method, +class addr;:client_address, +class
user;:username, +class pass;:password, +class frmu;:from_user, +class
svnm;:server_name, +class svpt;:server_port, +class scnm;:script_name, +class
ctyp;:content_type, +class refr;:referer, +class Agnt;:user_agent, +class
Kact;:action, +class Kapt;:action_path, +class Kcip;:client_ip, +class
Kfrq;:full_request
and I don't see PATH_INFO in there. Could it be you want to use
referred_by(referer) or script_name? These could be parsed to extract a
path_name.
Also, how can you generate a path like
http://www.server.com/calendar.cgi/2001/January?day=12
? That hardly seems like workable or valid syntax. I would expect
http://www.server.com/calendar.cgi?year=2001&month=January&day=12
Perhaps a code snippet could help.
Also, if you are not using Tanaka's osax to parse your CGI arguments, I
recommend it.
http://mtlab.ecn.fpu.ac.jp/tanaka_osax.html
Motoyuki, are you planning to update your osax for MacOS X please please
please?
Jeff Baumann
email@hidden
www.linkedresources.com
Better living thru Applescript
In a message dated 1/30/01 5:03:04 AM, Ted Wood wrote:
>
Calling all CGI Scripters...
>
>
I need help figuring out how to read the PATH_INFO variable hopefully
>
passed along with the WWW sdoc 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 WWW sdoc 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 WWW sdoc? 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.
>
>
Ted