html form and perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jdluk87
    New Member
    • Mar 2010
    • 5

    #1

    html form and perl

    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:
    Code:
    <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:
    Code:
    #!/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 :)
    Last edited by numberwhun; Mar 31 '10, 10:21 PM. Reason: Please use CODE TAGS!!!
Working...