The only difference is that I changed test.cgi to test.acgi. I have acgi dispatcher running (version 1.1) and I have web sharing on. When I click the submit button on the form I get the following error message:
The requested URL /CGI-Executables/test.acgi was not found on this server.
I stuck the cgi script in this folder because it seemed like a logical place to store it. But I also got the same results when I dump it in the Web Server/Documents folder as well.
I’ve established that I am doing something wrong, just not sure what. (Story of my life). Any help would be appreciated, speak slowly though as I am a newbie when it comes to cgi stuff.
acgi dispatcher works fine on my machine. Perhaps you are getting confused by the fact you install the CGIs in the “CGI-Executables” folder but that the URL to that folder from the webserver (Apache) is “cgi-bin”.
To get it to work, install Dispatcher & your AS CGIs in “/Library/WebServer/CGI-Executables”. Double-click Dispatcher, enter your password to update “/private/etc/httpd/httpd.conf” to include this line “Include /Library/WebServer/CGI-Executables/dispatcher.app/Contents/acgi.conf” and restart websharing. Then add this file to your CGI-Executables folder (save as an application with the name “text.acgi”):
property my_path : ""
property crlf : (ASCII character 13) & (ASCII character 10)
property http_header : "MIME-Version: 1.0" & crlf & "Content-type: text/html" & crlf & crlf
property CurrentFormData : {}
on handle CGI request path_args searching for http_search_args executing by the_link given «class TraL»:NewFormData
set my_path to the_link
set CurrentFormData to NewFormData as list
set the_text to GetFormData("the_text")
set return_page to http_header & "
<html>
<head>
<title>ACGI Test Results</title>
</head>
<body>
The text submitted was: " & the_text & "<br>
My path: " & my_path & "
</body>
</html>"
return return_page
end handle CGI request
on GetFormData(theKey)
set thisCount to length of CurrentFormData
repeat with i from 1 to thisCount
set tempList to item i of CurrentFormData
if item 1 of tempList is theKey then return item 2 of tempList
end repeat
return ""
end GetFormData
Next, make an HTML file named “cgi_test.html” placed in the root of your main webserver folder and include this text: