Hi,
I'm trying to use eval() within a while loop as such:
while(eval("\$retVal=isset(\$_POST['recalculate_qty\$x']);")){
$debug= " while loop entered";
}
echo $debug;
Unfortunately, it doesn't work (nothing gets printed for $debug in the above code). My goal is to loop through form variables that are named sequentially for each item in an online shopping cart, so I'm trying to loop through all of the form variables that start with the name "recalculate_qty" and then end with a number (eg, recalculate_qty1, recalculate_qty2, recalculate_qty3). The user chooses a different quantity in the shopping cart then presses a "recalculate" button which posts back to the same php script to recalculate the new values and redisplay their shopping cart. So I have to loop through to determine if each one is actually set or not.
Can anyone clue me in to why the code above doesn't work? Thanks for any help.