On Tue, Feb 05, 2002 at 10:28:32AM +0530, Sukanya S wrote:
> 
> Hi,
> 
> The ENV var QUERY_STRING would contain the
> entire query string passed to the cgi script.
> You have to parse it to get the values of each
> argument.
> 
> query.sh
> --------
> #!/bin/sh
> 
> echo ""
> echo "The query string received by script is $QUERY_STRING"
> 
        Apache require you to also provide the content-type header. So
you'll probably have to put in a `echo "Content-Type: text/plain"'.
Otherwise you'll get an error like this.

[error] [client 127.0.0.1] Premature end of script headers: <your cgi path>

        But this is *not* the best way to write cgi's because this 
violates HTTP spec since echo transmits <LF> instead of <CR><LF>.
So you'd be much better off writing.
        echo -en "Content-Type: text/plain\r\n"
        echo -en "\r\n"
        echo  "$QUERY_STRING"

        Anyway it's always safer and easier to use PHP to write dynamic stuff
(Perl anyone ?)
-- 
         **STATUTORY WARNING**
taking emails seriously is injurious to health

_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to