Mixed results with CGI
Richard Gaskin
ambassador at fourthworld.com
Sun Aug 25 05:38:00 EDT 2002
Dave Cragg wrote:
> At 10:56 pm -0700 24/8/02, Richard Gaskin wrote:
>> With this script on the server:
>>
>> #!mc
>> on startup
>> if $REQUEST_METHOD is "POST" then
>> read from stdin until empty
>> put it into buffer
>> put "Content-Type: text/plain" & cr
>> put "Content-Length:" && the length of buffer & cr & cr
>> put buffer
>> end if
>> end startup
>>
>> And this script in a local stack:
>>
>> on mouseUp
>> put "data=" & urlEncode( fld "s") into tData
>> post tData to url "http://www.fourthworld.net/cgi-bin/t.mt"
>> put it into fld "r"
>> end mouseUp
>>
>>
>> ...sometimes I get data returned from the server as expected, other times
>> "it" is empty.
>>
>> I'm using the latest version of libURL downloaded from runrv.com, under MC
>> 2.4.3 build number 3.
>>
>> Any clues on why it's sometimes working and sometimes not?
>
> To check if the problem is at the client or server end, you should
> check the result of the post statement.
>
> post tData to url "http://www.fourthworld.net/cgi-bin/t.mt"
> if the result is empty then
> put it into fld "r"
> else
> answer the result
> end if
>
> Also, to test if data is getting read in at the server end, you could
> add a line like this.
>
> read from stdin until empty
> put it into buffer
> put "EXTRA DATA" before buffer
> put "Content-Type: text/plain" & cr
> put "Content-Length:" && the length of buffer & cr & cr
> put buffer
>
Did that. It seems to be on the client side. All server data comes back as
expected, but the length of the data coming in from the cliebt is usually 0
(it works about 5% of the time, at seemingly random intervals).
--
Richard Gaskin
Fourth World Media Corporation
Custom Software and Web Development for All Major Platforms
Developer of WebMerge 2.0: Publish any Database on Any Site
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the metacard
mailing list