Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: How to convert an @ARGV to form based input?

by ig (Vicar)
on Aug 21, 2012 at 14:02 UTC ( #988744=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How to convert an @ARGV to form based input?
in thread How to convert an @ARGV to form based input?

From CGI:

It is possible for a script to receive CGI parameters in the URL as well as in the fill-out form by creating a form that POSTs to a URL containing a query string (a "?" mark followed by arguments). The param() method will always return the contents of the POSTed fill-out form, ignoring the URL's query string. To retrieve URL parameters, call the url_param() method. Use it in the same way as param(). The main difference is that it allows you to read the parameters, but not set them.

So, you can easily ignore parameters from the URL when using CGI. If you are parsing the CGI inputs otherwise, you will have to look to the tools you are using to find out what your options are. When you are delivering the blank form, you can ignore parameters entirely, if that suits you.

For an empty form input field, I would use something like:

<form method="POST" action="http://mydomain.tld/dnsdig.cgi"> <input type="text" name="domain"> <input type="submit" value="Submit"> </form>

If the user enters a URL that refers to your CGI script and includes a query string in the URL, you could detect this and issue a redirect to a URL without a query string.


Comment on Re^3: How to convert an @ARGV to form based input?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988744]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-11-23 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (134 votes), past polls