Ich habe ein formular z.B. mit zwei inputs
<input type="username" name="username" size="15" maxlength="40">
<input type="password" name="password" size="15" maxlength="15">Im perl steht dies:
my %input = parse_form();
Was ist das denn? CGI.pm macht das automatisch.
my $username = CGI::param('username')||'';
my $password = CGI::param('password')||'';
bad() unless ($username and $password);wie kann ich jetzt abragen mit perl ob noch andere inputs bzw. wieviel
inputs folgen?
Du bekommst alle Parameter, so wie es in der Dokumentation zum Modul beschrieben ist:
"FETCHING THE NAMES OF ALL THE PARAMETERS PASSED TO YOUR SCRIPT:
@names = $query->param
If the script was invoked with a parameter list (e.g. name1=value1&name2=value2&name3=value3''), the param() method will return the parameter names as a list. If the script was invoked as an <ISINDEX> script and contains a string without ampersands (e.g. value1+value2+value3'') , there will be a single parameter named keywords'' containing the +''-delimited keywords.
NOTE: As of version 1.5, the array of parameter names returned will be in the same order as they were submitted by the browser. Usually this order is the same as the order in which the parameters are defined in the form (however, this isn't part of the spec, and so isn't guaranteed)."
Struppi.