Classic CGI questions

Mark Schonewille m.schonewille at economy-x-talk.com
Fri May 13 11:14:37 EDT 2011


Hi Malte,

> Can I on the CGI side see the HTTP Headers I have set in the LC Client?

Yes, somehow. Try the environment variables perhaps? Check the globalnames. The CGI system I use keeps the most important headers in separate environment variables. I'm unable to get the complete headers at once. PHP would let you do that ;-)

> Can I find out how long the content being posted is?

Yes, in the headers or try $CONTENT_LENGTH

> What is the most reliable method to read in POST data without hogging 100% CPU time on the server machine?

Huh? AFAIK there is only one way:

read from stdIn until empty
read from stdIn until cr
read from stdIn for 100

Perhaps the hogging is not due to reading the data. Could it be a problem with not being able to show the interface?

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

New: Download the Installer Maker Plugin 1.6 for LiveCode here http://qery.us/ce

On 13 mei 2011, at 16:36, Malte Brill wrote:

> 
> Hi all,
> 
> as I did not do too many CGIs in the past, I´d like to reassure myself to find reliable methods of reading in post data. 
> 
> Why CGI and not revServer? - Need to deploy on a windows server (server 2003 running Apache)
> 
> I am posting data from a LiveCode Client to a Rev 3.5 CGI
> 
> Questions:
> 
> Can I on the CGI side see the HTTP Headers I have set in the LC Client?
> Can I find out how long the content being posted is?
> What is the most reliable method to read in POST data without hogging 100% CPU time on the server machine?
> 
> Thanks in advance,
> 
> Malte





More information about the use-livecode mailing list