On Mon, Mar 27, 2000, <[EMAIL PROTECTED]> wrote:
>Hello:
> I need to test the rebol interpreter, which has been
>recently installed on the server for my domain.
>Where can I get a the minimum code (like hello.r)
>to test it. Server is linux redhat 6.1
>thanks
>Tim
The following is pretty minimal. It will print out any path info found in
the url that invokes it. e.g.
http://www.yourdomain.com/cgi-bin/pathinfo.cgi/panfriedpancreas/ will
return a page containing
"/panfriedpancreas"
Just change the "path/to" in " #!path/to/rebol -cs" to the real path to
Rebol on your server, chmod +x the script to make it executable, and put
it in the appropriate place. Some servers require cgi scripts to be in a
special cgi-bin directory. Others don't.
.:Eric
Copy the following starting with the #! and save it to a file, such as
pathinfo.cgi
#!/path/to/rebol -cs
REBOL
[
Title: "Simple CGI"
Date: 27-Mar-2000
]
html-header: reduce ["Content-type: text/html" newline]
page: copy
{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
</head>
<body bgcolor="white" text="black">
<!--path-info-->
</body>
</html>}
path-info: copy ""
;Is there any path info?
if error? try [ path-info: copy system/options/cgi/path-info ]
[ path-info: "No path info" ]
page: replace page "<!--path-info-->" path-info
print html-header
print page
quit