[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

No Subject



> Date: Mon, 19 Jun 2000 10:11:58 +1000
> From: George Vieira <georgev@nospam.citadelcomputer.com.au>
> Subject: [SLUG] Perl last hope..
> 
> Hi all,
> 
> OK.. I found what's going on but again I have no idea why it's doing this..
> 
> My "signup.cgi" is calling "counter.cgi" OK but is failing to pass the
> "domain" and "page" parameters over on the command line:
> $outcount=`/home/httpd/cgi-bin/counter.cgi domain=www.hexidecimal.com.au
> page=signup visible=true`;
> 
> inside of the counter.cgi script...
> domain=""
> page=""
> 
> Why does this fail? Is there another syntax to send to a CGI within a CGI???
> Works fine on the shell prompt but not within another CGI?
> 
> Any help by your Perl experts would be appreciated...

Are you *sure* it worked from the command line, did it ask you for
parameters perhaps? 

The problem here is you don't seem to understand what CGI
means. Literally, Common Gateway Interface. It refers to the method by
which a web server passes information to an external program, hence
the gateway. 2 methods are used, GET and POST.
GET assigns the web variables to the shell environment QUERY_STRING,
POST passes all the info as standard input. The type used is specified
in the METHOD field in the FORM tag of a HTML document.

To test the scripts from the command line you would do similar to:

GET:
$ export QUERY_STRING="domain=www.hexidecimal.com.au&page=signup
&visible=true"
$ ./counter.cgi

POST:
$ export QUERY_LENGTH=100	{bytes of input}
$ echo "domain=www.hexidecimal.com.au&page=signup&visible=true" |
./counter.cgi

Of course.. my memory is rusty, you'll have to lookup the exact
variables and such from probably www.w3.org

Also, some great insight might be gained from actually finding the
CGI.pm module on your system and having a look at it. 

$ perldoc CGI


---<GRiP>---
Grant Parnell gripz@nospam.linuxfreak.com (gparnell@nospam.bigpond.net.au) 
Ph: 02-8701-4564 Mob: 0408-686-201 Web: http://www.poboxes.com/gripz
No Microsoft products were used in the production of this message.

--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to slug-request@nospam.slug.org.au with
unsubscribe in the text