in reply to Re: Re: CGI Parameters
in thread CGI Parameters
The CGI->http method lets you access those environment variables starting with 'HTTP', yes. But what you seem to be missing is that those environment variables are set by the webserver to the value of the HTTP headers sent in the request. For example, if you sent this request to you CGI:
GET /my_cgi.pl HTTP/1.1 Host: localhost Foo: FOO Content here
...then the following code should get you the value 'FOO Content here':
use CGI; my $q = CGI->new; my $foo_content = $q->http("Foo"); # or $q->http("HTTP_FOO")
Update: I see that etcshadow dealt with this in full elsewhere in the thread... hey, a little repetition never hurt anybody, right?
|
|---|