Re: How to make a simple applescript work as a CGI? seems IMPOSSIBLE!
Re: How to make a simple applescript work as a CGI? seems IMPOSSIBLE!
- Subject: Re: How to make a simple applescript work as a CGI? seems IMPOSSIBLE!
- From: email@hidden
- Date: Mon, 11 Feb 2002 18:42:44 EST
Take heart, it's definitely possible. You're missing the header info. A CGI
is responsible for returning a complete http response, not just the html. And
lose Applescript 1.6 - it's broken for CGIs.
For more information (including the header info), visit
http://www.linkedresources.com/teach/applescript/writingCGIs.shtml
Jeff Baumann
email@hidden
www.linkedresources.com
In a message dated 2/11/02 3:00:13 PM, mfmoore wrote:
>
I'm just trying to learn how to do this, and I'm beginning to think
>
this is not actually possible.
>
>
I have a very simple script that I save as "Test.acgi" , as a "Stay
>
Open" ,"Never Show Startup Screen", classic applet. It is as follows:
>
=====================================================================
>
on handle CGI request myURL
>
set mystring to "<head>" & dostuff(myURL) & ,
>
"</head>"
>
return mystring
>
end handle CGI request
>
>
on dostuff(astring)
>
return "It REALLY worked!"
>
end dostuff
>
=====================================================================
>
I've saved that file and the following in the exact same folder, my
>
"Documents:Webpages" folder.
>
>
and then I have a very simple html page that looks like this:
>
=====================================================================
>
>
<form method="post" action="http://99.99.99.99/test.acgi" > *
>
<input type= text name="name" >
>
<input type=submit>
>
>
=====================================================================
>
(* for 99.99.99.99 see below)
>
>
and the idea is I can type in some text into the text box, click the
>
Submit button, and a second page will pop up, saying nothing more
>
than "It REALLY worked!" ...
>
>
but... it DOESN'T!
>
>
I went to the web sharing control panel, and I turned it ON,
>
identifying "Documents:Webpages" as the folder to share, and
>
Test.html as the homepage. Once I get an IP address, I replace the
>
99.99.99.99 above with the number given to me. I've tried this with
>
file sharing (read/write for everybody) or without (read only for
>
everybody). no difference.
>
>
I open up Opera 5.0, or Netscape 4.75, and type in
>
http://99.99.99.99, and I see my goofy little page - wonderful.
>
until I click the Submit button - I see the url pop into place:
>
http://99.99.99.99/test.acgi , and then it just goes into
>
neverneverland, finally coming back complaining
>
>
"A CGI or internal server component could not complete the requested action."
>
>
I've tried using "POST", and "GET", but nothing seems to result in
>
any action at all.
>
>
other details:
>
>
mac b&w g3, os 9.1
>
384 mb RAM
>
apple script 1.6
>
>
any help would be appreciated! thank you very much!
_______________________________________________
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.