Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

<FORM onkeypress="return event.keyCode != 13;" ACTION = "/cgi-bin/shh +abcam/parse_params.cgi $user" METHOD = "get">

I would like to pass a parameter (in this case '$user') to the 'action' program. I am finding that the parameter is getting attached to the action program file name (looks like: 'parse_params.cgi test'). Is there any way to do this?

Replies are listed 'Best First'.
Re: pass parameter in form action
by Corion (Patriarch) on Aug 18, 2017 at 14:05 UTC

    Maybe now is a good time to find out what a URI is?

    print << HTML; <FORM onkeypress="return event.keyCode != 13;" ACTION = "/cgi-bin/sh +habcam/parse_params.cgi?user=$user" METHOD = "get"> HTML

    Also consider what to do about usernames like foo;admin=true or other such stuff, or users with names like

    ><script>alert("Hello Nurse!")</script>
    .

      thanks