• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CGI error problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGI error problems


  • Subject: Re: CGI error problems
  • From: email@hidden
  • Date: Fri, 7 Sep 2001 22:06:53 EDT

Ah, the power of the typo!

The line which begins

set myHTML to "HTTP:1.0 200 OK" & crlf ......

should actually be

set myHTML to "HTTP/1.0 200 OK" & crlf ......

If that doesn't work, might I refer you to

http://www.linkedresources.com/teach/applescript/writingCGIs.html

It contains a well tested workable CGI example. If that does not work, there
must be something about your particular setup causing the problem.

I start all my CGIs with these lines (watch line feed)

property crlf : (ASCII character 13) & (ASCII character 10)

property http_10_header : "HTTP/1.0 200 OK" & crlf & "Server: WebSTAR" & crlf
& "MIME-Version: 1.0" & crlf & "Content-type: text/html" & crlf & crlf

property redir_header : "HTTP/1.0 301 REDIRECT" & crlf & "Server: WebSTAR" &
crlf & "Location: "

This keeps them from cluttering up the main script, plus I think properties
are faster to use than assigning values to variables (and every millesecond
counts with a CGI).

Jeff Baumann
email@hidden
www.linkedresources.com


In a message dated 9/7/01 6:27:47 PM, Steve Kump wrote:

>Hi List,
>
>I'm very frustrated with the results I am getting from on handle CGI request.
>
>EVERY time I get a network error connection when calling the acgi.
>
>"The attempt to load "Accessing URL:
>http://192.168.1.2/cgi-bin/script.acgi?name=test' failed"
>
>Running IE Mac 5
>WebStar 4.4
>OS 9.1 with AS 1.6
>
>The scripts are open so the bug with the closed scripts shouldn't be
>a problem here. I am simply trying to get a very basic sample going
>from the Applescript in a Nutshell reference book:
>
>on handle CGI request myURL searching for mySearchArgs
>
> set myArgList to (tokenize mySearchArgs with delimiters {"&", "="})
>
> set mySearchValue to (offset in list myArgList of "name" with
>returning next item)
>
> set crlf to (ASCII character 13) & (ASCII character 10)
>
> set myHTML to "HTTP:1.0 200 OK" & crlf & "Server:
>WebSTAR/4.4" & crlf & "MIME-Version: 1.0" & crlf & "Content-type:
>text/html" & crlf & crlf
>
> set myHTML to myHTML & "Your name is " &
>mySearchValue & ""
> return myHTML
>
>end handle CGI request
>
>Everything I have tried so far, even the SIMPLEST of scripts that
>should only return "Hello!" result in a failed connection, although
>WebStar seems to retrieve the results correctly and pass then to the
>client. I have followed the web monitor closely and have verbose
>messaging enabled so I can see exactly what is happening.
>
>(Using the ACME tokenize osax)
>
>Thanks for any ideas or help!
>
>--
>Steve Kump
>Xpressdocs
>2916 W 6th Street
>Fort Worth, TX
>76107


  • Prev by Date: RE: Time Delay
  • Next by Date: Re: Applescript and ImageReady
  • Previous by thread: CGI error problems
  • Next by thread: Quark ­ List of selected boxes
  • Index(es):
    • Date
    • Thread