Hi all, If you really want to see how much of a trouble you are in for look at this slideshow, where the first three slides will convincingly explain to you with sample code why writing CGI scripts in C is a *BAD* idea.
Hmm.. and ofcourse why PHP rocks ;-) http://conf.php.net/pres/index.php?p=slides%2Fintro&id=ac2 -Srini -- http://www.symonds.net/~sriniram ----- Original Message ----- From: "Gopz" <[EMAIL PROTECTED]> To: "Sukanya S" <[EMAIL PROTECTED]> Cc: "Logu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; "Linux-India" <[EMAIL PROTECTED]> Sent: Tuesday, February 05, 2002 3:26 PM Subject: Re: [ilugc] shell an dcgi > 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 > --- > Visit our home page at: http://www.chennailug.org > Send e-mail to "[EMAIL PROTECTED]" with "unsubscribe" > in either the subject or the body to unsubscribe from this list. > > _______________________________________________ linux-india-help mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/linux-india-help
