Please forgive me if I read your code wrong, Javascript isn't my first language. Couldn't you remove the Javascript and do this.
#!/usr/local/bin/perl -wT use CGI qw(:standard); use strict; my $num = param('number'); #has to be numeric my $let = param('lets'); #has to be letters my $both = param('both'); #can be letter or number die "Invalid datatype for num" if $num =~ /[^0-9]/; die "Invalid datatype for let" if $let =~ /[^a-zA-Z]/; die "Invalid datatype for both" if $both =~ /[^0-9a-zA-Z]/; die "num can not be null" unless defined $num; die "let can not be null" unless defined $let; die "both can not be null" unless defined $both;
Many other security measures could be taken as well, I suggest you check out Ovid's Course in the Tutorials section for better examples.
"Pain is weakness leaving the body, I find myself in pain everyday" -me
In reply to Re: A problem use CGI.pm
by kutsu
in thread A problem use CGI.pm
by lgjut
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |