html form and perl
Added by jdluk87 about 15 years ago
Hi to everyone, I have a problem with a simple html form that send simple data to my perl script, i remember, but i'm not sure, that without fastcgi this working fine, but with fastcgi nothing to do. The code now:
Form:
<form name="myForm" method="post" action="regScript.pl"><br />
Nome:
<input type="text" name="Nome"><br />
Cognome:
<input type="text" name="Cognome"><br />
Matricola:
<input type="text" name="Matricola"><br />
Password:
<input type="text" name="Password"><br />
<input type="submit" name="subbtn" value="Submit">
</form>
Script:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
read(STDIN, $FormData, $ENV{'CONTENT_LENGTH'});
@dati = split(/&/, $FormData);
foreach $el (@dati) {
($name, $value) = split(/=/, $el);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
print $FORM{'Name'};
this was more complicated but just for trying I print a single field of html form...but doesn't work!!!
Someone can help me please?
Sorry form my english :)
Replies (5)
RE: html form and perl - Added by jdluk87 about 15 years ago
thank you for the reply, but in this document i find just how create html form with perl, and doesn't solve my problem
RE: html form and perl - Added by darix about 15 years ago
you want to read it again. slowly. and try to understand it ... it also explains how to handle the form values in your app.
RE: html form and perl - Added by stbuehler about 15 years ago
Also you should know that you cannot just use a CGI script as FastCGI, for perl you probably want to read http://perldoc.perl.org/CGI/Fast.html if you want/need FastCGI (and read some more docs about how FastCGI works and our mod_fastcgi wiki page).
RE: html form and perl - Added by jdluk87 about 15 years ago
how can convert the tag: label with perl?