Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
Problems? Is your data what you think it is?
 
PerlMonks  

RE: Avoiding GET in CGIs

by le (Friar)
on Jul 13, 2000 at 13:54 UTC ( [id://22378]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Avoiding GET in CGIs

Whenever you try to do some CGI task in Perl, you are urged to use CGI.pm (it's part of the standard distribution of newer Perls). So to avoid GETs:
use CGI; my $q = CGI->new; if ($q->request_method() eq "GET") { # do something print $q->redirect("http://somewhere.org/"); exit; }

Replies are listed 'Best First'.
RE: RE: Avoiding GET in CGIs
by Michalis (Pilgrim) on Jul 14, 2000 at 06:13 UTC
    I am using CGI.pm (actually a heavily modified version of it) but I was unaware of that function.
    Thanks for pointing that out. It looks (and probably is) better.
    It also works with parameters in the Location Bar (and not only if the form is submitted through a GET).
    The only problem I see with that is (is it really?) performance issue as you have to create the new CGI object before the check.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://22378]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.