Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Avoiding GET in CGIs

by turnstep (Parson)
on Jul 15, 2000 at 00:51 UTC ( [id://22635]=note: print w/replies, xml ) Need Help??


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
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2025-04-28 21:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.