in reply to get parameter from html page
#!/usr/local/bin/perl -w use CGI qw(:standard); #my $name = undef; # is ok, but you'll get a warning if $name is blank +. my $name = param("name") || ''; # better for warn! print "Content-type: text/html\n\n"; # Setup the header for the browse +r print "value = ",$name, "\n";
print "Content-type: text/html\n\n"; # Setup the header for the browse +r my $name = param("name") || ''; # Allow only numbers, letters and _ if ($name && $name !~ m/^[0-9A-Za-z_]+$/i) { print 'Error: Bad input Format'; exit; # Stop script }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: get parameter from html page
by AK108 (Friar) on Dec 23, 2006 at 02:11 UTC |