A
alexjaquet
Hi,
I could not figure why my expression doesn't work
I want to accept only digit sample code I use :
local our $quantity = $query->param ("quantity"); #parameter = asdfasdf
if (!$quantity =~ /^[0-9]/) {
print "Content-Type: text/html\n";
local our $url = $ENV{'HTTP_REFERER'};
$url = $url."&error=$SERVER{'not_decimal'}";
print "Location: $url\n\n";
}else {
print "Content-Type: text/html\n\n";
print "quantity : $quantity\n";
}
the problem I got is I always do the else part
I could not figure why my expression doesn't work
I want to accept only digit sample code I use :
local our $quantity = $query->param ("quantity"); #parameter = asdfasdf
if (!$quantity =~ /^[0-9]/) {
print "Content-Type: text/html\n";
local our $url = $ENV{'HTTP_REFERER'};
$url = $url."&error=$SERVER{'not_decimal'}";
print "Location: $url\n\n";
}else {
print "Content-Type: text/html\n\n";
print "quantity : $quantity\n";
}
the problem I got is I always do the else part