peacePipe
 Limitations
 Download
 Installation
 Scripting
 Version History
 Credits

Scripting notes:


1.HTTP headers may need to be tweaked slightly. Thus, a CGI building an HTML page, or redirecting to a page is likely to include code like this:

property crlf : (ASCII character 13) & (ASCII character 10)
property redirect_header : "HTTP/1.0 302 Found" & crlf & "Location: "
property OK_header : "HTTP/1.0 200 OK" & crlf & "Content-type: text/html" & crlf & crlf

and in the "handle CGI request" handler (subroutine)

return OK_header & "<HTML><body><h1>My Web Page</h1> ... </body></html>"

or

return redirect_header & "http://www.example.com/web/page.html" & crlf & crlf
2.The CGI script MUST have the ".acgi" extension to be properly handled by the ACTION defined during the configuration of apache shown above (Installation step 1).
3.The script will be able to reference almost any of the standard "sdoc" (handle CGI request) parameters (sample variable names shown in italics below), though a few are not fully supported (see comments at right):

on handle CGI request path_args ¬ -- same as search_args
 searching for search_args ¬ -- text following a "?" on the CGI URL
with posted data post_args ¬ -- form data
using access method method ¬ -- generally GET or POST
from address client_address ¬ -- same as client_IP
from user username ¬ -- only if CGI is in a realm
using password pw ¬ -- provision is browser-dependent
with user info from_user ¬ -- rarely provided (used to be user email)
from server server_name ¬ -- server's DNS name
via port server_port ¬ -- TCP/IP port number (usually 80)
executing by script_name ¬ -- URL path to CGI (eg "/cgi-bin/test.acgi")
referred by referrer ¬ -- full URL of page providing link to this page
from browser user_agent ¬ -- name (&etc) of user's browser
using action act ¬ -- "ACGI"
of action type atype ¬ -- "ACGI"
from client IP address client_IP ¬ -- TCP/IP number for user's computer
of content type content_type ¬ -- MIME content type of form data, if present
with full request fullreq ¬ -- ""
with connection ID connID ¬ -- ""
from virtual host vdir -- Mac-style path to server root (eg "Macintosh HD:Library:WebServer:Documents:")