Hi folks,
I hope the Perl gods of the forum will smile on me and show me the error of my ways.
I have a shopping cart program that assigns field name on a per item basis (like $FORM{desc1}, $FORM{desc2}, etc)and I want to send the contents of the order form to an email address.
Now the email is working fine, however my problem is this : People may order more than one item, resulting in a form with many $FORM{descX}, where X is the number of items being orders. I don't want to hand code inputs to the email for $FORM{desc1-infinity} for obvious reasons(person may order one item), so what I have been attempting to do is this:
for ($i=1; $i<100; $i++){
while ('FORM{desc$i}'){
$body .= "Item :" . "('$FORM{desc$i}')\n";
}
}
This produces a server error "Invalid response". I have tried different combinations of quoting $i to try and get the value to read in to the FORM var (like desc3) to no avail.
Can anyone shed any light on the best way to accomplish my objective ?
Thanks much.
I hope the Perl gods of the forum will smile on me and show me the error of my ways.
I have a shopping cart program that assigns field name on a per item basis (like $FORM{desc1}, $FORM{desc2}, etc)and I want to send the contents of the order form to an email address.
Now the email is working fine, however my problem is this : People may order more than one item, resulting in a form with many $FORM{descX}, where X is the number of items being orders. I don't want to hand code inputs to the email for $FORM{desc1-infinity} for obvious reasons(person may order one item), so what I have been attempting to do is this:
for ($i=1; $i<100; $i++){
while ('FORM{desc$i}'){
$body .= "Item :" . "('$FORM{desc$i}')\n";
}
}
This produces a server error "Invalid response". I have tried different combinations of quoting $i to try and get the value to read in to the FORM var (like desc3) to no avail.
Can anyone shed any light on the best way to accomplish my objective ?
Thanks much.