Hello. I have this loop :
Now I am trying to create a string variable to hold all this results, so, the variable must get appended the whole time, and then stored inside a Hidden field. Simple. NO!Code:foreach ($_POST['ordered'] as $key=>$id) { echo '<p/> ProdName: ' , $prod[$id]['name'] , '<br/> ProdPrice: ' , $prod[$id]['price'] , '<br/> ProdQty: ' , $prod[$id]['qty'] , ' <hr/>'; }
I have tried this :
Nothing gets stored inside strOrder.Code:$strOrder = ""; foreach ($_POST['ordered'] as $key=>$id) { echo '<p/> ProdName: ' , $prod[$id]['name'] , '<br/> ProdPrice: ' , $prod[$id]['price'] , '<br/> ProdQty: ' , $prod[$id]['qty'] , ' <hr/>'; $strOrder .= $key . " " . $id;
I created the hidden fields like this :
But NOTHING gets stored in any of them either.....Code:$TOT2 = $TOT + 55; echo '<input type="hidden" Name="TOT" value ="'. $TOT .'">'; echo '<input type="hidden" name="TOT2" value =". $TOT2 .'">'; echo '<input type="hidden" name="Order" value=". $strOrder . '">';
What am I doing wrong now??




Reply With Quote