$q = new CGI;
$query = $q->param( 'POSTDATA' );
===================================
will return the contents of this URI:
http://server/cgi.cgi?POSTDATA=posteddata
How do I code so that I don't have to use POSTDATA?
I know it's a silly question and probably obvious, but not to me
Thanks
In this case "$query" will return "posteddata", the value of the HTTP
parameter of POSTDATA (a "GET" one in this case.).
> How do I code so that I don't have to use POSTDATA?
What do you want to do exactly?
Regards,
Shlomi Fish
>
> I know it's a silly question and probably obvious, but not to me
>
> Thanks
>
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Interview with Ben Collins-Sussman - http://shlom.in/sussman
Bzr is slower than Subversion in combination with Sourceforge.
( By: http://dazjorz.com/ )
Shlomi Fish wrote:
> On Thursday 31 Dec 2009 00:28:51 Bruce Ferrell wrote:
>> I see on the CGI web page that this:
>> ===================================
>> use CGI;
>>
>> $q = new CGI;
>>
>> $query = $q->param( 'POSTDATA' );
>> ===================================
>>
>>
>> will return the contents of this URI:
>>
>> http://server/cgi.cgi?POSTDATA=posteddata
>>
>
> In this case "$query" will return "posteddata", the value of the HTTP
> parameter of POSTDATA (a "GET" one in this case.).
>
>> How do I code so that I don't have to use POSTDATA?
>
> What do you want to do exactly?
>
> Regards,
>
> Shlomi Fish
>
>> I know it's a silly question and probably obvious, but not to me
>>
>> Thanks
>>
>
Well, I thought something I was looking at implied I didn't have to use
name/value pairs. I got out my handy dandy sniffer and it appears I was
utterly incorrect... Unless you tell me otherwise :)
Well, you can always use PATH_INFO:
http://myhost.tld/cgi-bin/my.cgi/more/path/here/
And retrieve it using $cgi->path_info().
Is this what you are looking for?
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Parody on "The Fountainhead" - http://shlom.in/towtf
> I see on the CGI web page that this:
> ===================================
> use CGI;
>
> $q = new CGI;
>
> $query = $q->param( 'POSTDATA' );
> ===================================
>
>
> will return the contents of this URI:
>
> http://server/cgi.cgi?POSTDATA=posteddata
>
> How do I code so that I don't have to use POSTDATA?
It was you who defined the variable name, i.e. POSTDATA. You can change the name to something else.
Or are you trying to get rid of the key value pairs entirely? That unfortunately won't work since HTTP is a 'stateless' protocol and if you want the remote machine to calculate something with your input you'll have to provide input and key value pairs is the way its done.
Jeremiah