By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,773 Members | 1,724 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,773 IT Pros & Developers. It's quick & easy.

html form and perl

P: 5
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:
Expand|Select|Wrap|Line Numbers
  1. <form name="myForm" method="post" action="regScript.pl"><br />
  2. Nome:
  3. <input type="text" name="Nome"><br />
  4. Cognome:
  5. <input type="text" name="Cognome"><br />
  6. Matricola:
  7. <input type="text" name="Matricola"><br />
  8. Password:
  9. <input type="text" name="Password"><br />
  10. <input type="submit" name="subbtn" value="Submit">
  11. </form>
  12.  
Script:
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. print "Content-type: text/html\n\n";
  3.  
  4. read(STDIN, $FormData, $ENV{'CONTENT_LENGTH'});
  5.  
  6. @dati = split(/&/, $FormData);
  7.  
  8. foreach $el (@dati) {
  9.  
  10. ($name, $value) = split(/=/, $el);
  11.  
  12. $value =~ tr/+/ /;
  13.  
  14. $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
  15.  
  16. $FORM{$name} = $value;
  17. }
  18.  
  19. print $FORM{'Name'};
  20.  
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 :)
Mar 31 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.