For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > January 2006 > script problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author script problem
birdhope

2006-01-13, 12:18 pm

Hello
I'm adding some script so that a person has to check "agree" in a form to proceed to $add_to_cart?info'. I'm not quite sure what I'm doing wrong.

### Return error if agree is not selected

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}


if ($FORM{'testagree'} eq "" or $FORM{'termsagree'} eq "") {
dienice("Please fill out the fields that you agree to terms and conditions.");
}
elsif ($FORM{'testagree'} eq "Agree" or $FORM{'termsagree'} eq "Agree") {
$Agree = $FORM{'$add_to_cart?info'};
}

###############

TIA
Birdhope
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com