Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://988744]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2018-02-18 22:42 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (257 votes). Check out past polls.