I have a form that submits multiple hidden fields. Part of this form submits a field called $Orderline1
(40 orderlines total - $Orderline1 - $Orderline40). I'm trying to determine how many fields have data
but I keep getting errors with my eval!
I have tried:
$cnt = 1;
$orders = 1;
while ($orders){
eval("if($OrderLine"+$cnt+" != '')"){
echo $cnt;
}else{ $orders = 0;}
$cnt++;
}
//////////////////////////////////////////////////
I have also tried the eval line as:
if(eval("$OrderLine"+$cnt) != ""){
But I can't get the eval to work! Is this the best way to figure out how many fields have data and if
so what is the eval statement. If not then what is the best way?