CGI.pm and POST vs GET methods 
Author Message
 CGI.pm and POST vs GET methods

I;m just learning CGI using perl's CGU.pm.

I have been using the froms support built inot it, whch appears to be based
upon the POST method, right? So the name value pairs come in on stndard
input.

I am having a problem passing hidden value pairs back to the script when I
use it to fill in the frames of a frameset.

It has been sugested that I use the GET method, which passes the name value
pairs back as a part of teh URL. I don;t really have a problem with this,
since in my case, there  is no security issue involved.

So the question is, is the any support for using the GET method with
CGI.pm? If not is there anoth appropriate module? Or do I just have to code
this myself?

If that's the case, how will the script see these name vaule pairs? As
command line arguments or what?



Sun, 13 Jul 2003 03:54:21 GMT  
 CGI.pm and POST vs GET methods


Quote:
> I;m just learning CGI using perl's CGU.pm.

> I have been using the froms support built inot it, whch appears to be
based
> upon the POST method, right?

-------------
CGI.pm supports both GET and POST.
Did you read the included docs?
How are you attempting to "pass back" information to the browser?

also, there are other newsgroups that may be more helpful for cgi
discussions... try searching deja for "cgi"

D

Sent via Deja.com
http://www.deja.com/



Sun, 13 Jul 2003 04:30:52 GMT  
 CGI.pm and POST vs GET methods

Quote:
> I;m just learning CGI using perl's CGU.pm.

> I have been using the froms support built inot it, whch appears to be based
> upon the POST method, right?

Not necessarily.  CGI.pm supports either method.  The grounds for you
to choose GET or POST are, I thought, reasonably well documented in
CGI specs and tutorials, and aren't at all specific to Perl, so if you
can't decide which you want to use, I'd recommend looking over there
somehow (sorry, this all seems so natural to me that I don't have a
specific tutorial at my fingertips to suggest to you).

At any rate the fact that you're using CGI.pm has no impact at all on
which of the two you should choose - quite the contrary, since it does
all the work for you behind the scenes and saves you the effort of
having to code for one or the other (or indeed for debugging from the
keyboard, which it also supports).

As far as CGI.pm is concerned, it's not entirely clear to me from your
posting just where you're getting your documentation from, but if you
aren't using the author's book, then I'd recommend the author's own
HTML documentation, at http://stein.cshl.org/WWW/software/CGI/

The POD documentation that comes as standard with Perl is adequate-ish
(it also exists in an HTML-ified version - but don't confuse that with
the author's own HTML documentation).

I'm given to understand that this discrepancy is being worked on and
will be better in later versions.

Quote:
> So the name value pairs come in on stndard
> input.

With POST this is true, but it's nothing that you need to be concerned
about if you're using CGI.pm, beyond making the choice of "method" on
your startform() call.

Quote:
> I am having a problem passing hidden value pairs back to the script when I
> use it to fill in the frames of a frameset.

Sigh.  The world would be a much better place if authors and readers
didn't spend a significant fraction of their time messing about with
the pointless complexities of that unwanted Netscape excresence,
"frames".  However...

Quote:
> It has been sugested that I use the GET method,

From what little detail of what you're _really_ trying to achieve
(rather than the fragments of some unfinished implementation that you
tell us doesn't seem to be working, but we've no idea what it's
supposed to do, that you've presented here)  it's hard to comment, but
you do seem to have said enough to suggest that there are a few
misconceptions that could usefully be resolved first.

That's OK, any learning process is liable to be like that, but don't
bite off too much to chew; take it a piece at a time.  Well, that's
what I try to do, anyhow, and it seems to work for me.

Quote:
> pairs back as a part of teh URL. I don;t really have a problem with this,
> since in my case, there  is no security issue involved.

The choice of GET v. POST would hardly be made on the basis of any
genuine issue of security, I'd have thought.  All the details are
openly there in the source, even if they don't show in the URL. I'm
not going to write an essay on that because this is the wrong place
for it and there are several ifs-and-buts.  Perhaps
http://www.htmlhelp.org/faq/cgifaq.2.html#9 would be a start.

Quote:
> So the question is, is the any support for using the GET method with
> CGI.pm?

Sure.  In the Abstract right at the start of the author's writeup,
paragraph 2, it says

   CGI objects handle POST and GET methods correctly,

It's hard to see how you could miss it, if you had found your way to
the documentation.  Which is why I was wondering just what
documentation you _are_ working to.

good luck

--

     In programming there is no "almost always", it is one of "always",
         "never", and "undefined".  - Ilya Zakharevich on c.l.p.misc



Sun, 13 Jul 2003 04:32:25 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CGI.pm get and post methods exclusive?

2. POST method and cgi.pm

3. Post vs Get method

4. CGI.pm vs. Base.pm

5. CGI-modules vs. CGI.pm

6. cgi-lib.pl vs CGI.pm?

7. cgi-lib.pl vs CGI.pm

8. cgi.pm .vs. cgi-lib.pl

9. Faking POST method in CGI scripts???

10. Perl CGI Script METHOD=POST problem

11. forceing only post methods with perl CGI module

12. Problem using DBI and CGI on POST method

 

 
Powered by phpBB® Forum Software