in reply to A problem use CGI.pm
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: A problem use CGI.pm
by lgjut (Initiate) on Oct 29, 2003 at 04:52 UTC | |
by menolly (Hermit) on Oct 31, 2003 at 00:24 UTC | |
by bradcathey (Prior) on Nov 02, 2003 at 14:33 UTC | |
by tilly (Archbishop) on Nov 02, 2003 at 19:16 UTC | |
by menolly (Hermit) on Nov 03, 2003 at 17:56 UTC | |
by kutsu (Priest) on Nov 02, 2003 at 18:45 UTC |