Re: Elucidating passed parameters
Re: Elucidating passed parameters
- Subject: Re: Elucidating passed parameters
- From: JJ <email@hidden>
- Date: Wed, 09 Oct 2002 22:44:42 +0200
>
Hi
>
>
I'm hoping to create an AppleScript CGI which will grab an incoming
>
hostname and then redirect based on this. For an AppleScript CGI, one
>
sets up a handler "on handle CGI request ...". This handler is passed a
>
bunch of parameters, one of which should be the full request. From this
>
I can work out which host was called etc. However, I can not work out
>
the correct syntax for this. How can one get a list of all the
>
parameters being passed to a handler? Indeed, is this possible?
>
>
TIA
>
>
Simon Forster
>
_________________________________________________
Hi, Simon, all:
If I understand properly the question, then:
-open "Standard Additions" dictionary with your favourite script editor.
-navigate through "handle cgi request" command and you'll see all parameters
which are [can be] passed to a "handle cgi request"-handler (see below).
Traditionally, this command is used to _receive_ and parse data from a web
server. The server passes your script "x" parameters (depending on the type
of the transaction). To simulate a simple search query, try this:
-- simulates url "
http://www.server.com/script.cgi?data=hamburguer"
handle CGI request "
http://www.server.com/script.cgi" searching for
"data=hamburguer"
on handle CGI request path_url searching for x
return x
end handle CGI request
JJ
_______________
handle CGI request: Sent to a script to process a Common Gateway Interface
request (defined in: Standard Additions)
handle CGI request string -- the path of the URL
[searching for string] -- the data for the GET method or data after
the ?9 in a POST method
[with posted data string] -- the POST arguments
[of content type string] -- the MIME content type of POST arguments
[using access method string] -- either GET9 or POST9
[from address string] -- the IP address of the entity making the
request
[from user string] -- the user name associated with the request
[using password string] -- the password sent with the request
[with user info string] -- additional information about the user,
usually the email address
[from server string] -- the name of the server application sending
this request
[via port string] -- the IP port number of the server
[executing by string] -- the path to the script executing this CGI,
in URL form
[referred by string] -- the URL of the page the client used to link
to the CGI
[from browser string] -- the name of the client software
[using action string] -- the path to the file or CGI
[of action type string] -- either PREPROCESSOR, POSTPROCESSOR, CGI,
or ACGI
[from client IP address string] -- the Internet address of the
client
[with full request string] -- the full request as sent to the
server
[with connection ID integer] -- the ID of the connection from the
server to the client
[from virtual host string] -- the URL of the root folder of the
virtual host
Result: web page -- An HTML page resulting from the CGI execution
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.