Beefy Boxes and Bandwidth Generously Provided by pair Networks Ovid
Keep It Simple, Stupid
 
PerlMonks  

Re: Avoiding GET in CGIs

by turnstep (Parson)
on Jul 14, 2000 at 20:51 UTC ( [id://22635]=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

To answer the question directly:

No, there are no real side-effects to this method. That way should work just fine. It might be fastest if you have this run before loading CGI.pm (via a BEGIN block). You could also check for

$ENV{'REQUEST_METHHOD'} ne "POST" ## or $ENV{'REQUEST_METHOD'} eq "GET" ## or even $ENV{'REQUEST_URI'} =~ /\?/
Finally, note that you original code, technically speaking, should test for the existence of QUERY_STRING, and not the truth of it, using defined or even exists. But since most cgi scripts require a pair, putting ?0000 will probably not do much for your scripts, so the truth test should suffice.

P.S. Sure it can be worked around, but it *will* prevent people from being able to bookmark a URL with parameters already set.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://22635]
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.