Hello
I need to pass some params from a web form to a CGI script. Some params are passed by the user, others are "hard coded". My CGI strangely reads only the ones passed by the user, not the hard coded ones. Any idea?
<form action="/cgi-bin/delete.pl?key=gfgf&usr=rob" method="get" accept
+-charset="UTF-8">
<div class="form-group">
<label for="id"> Your token</label>
<input id="id" name="token" type="text" class="form-control" reado
+nly >
</div>
<div class="form-group">
<button name="submit" type="submit" class="btn btn-primary">Delete<
+/button>
</div>
</form>
The CGI
#!/usr/bin/perl -T
use warnings;
use strict;
use CGI qw(-utf8);
use CGI::Carp qw(fatalsToBrowser);
my $q = CGI->new();
my $token = $q->param('token');
my $key = $q->param('key');
my $usr = $q->param('usr');
print $q->header("text/html;charset=UTF-8");
print "Token: $token - Key: $key - Usr: $usr";
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|