Help with code in hidden field
Posted: Mon Jul 18, 2005 11:09 pm
I have to put this code into a hidden field named "shipping" so I can pass it to the next form
<?php if ($total > 81.75) {printf ("%01.2f", $total * .11);}else {echo "8.99 ";}?>
so far no luck - I can get the code to display on the page, but get parse errors when I try to put it in a hidden field
<input type="hidden" name="shipping" value="<?php if ($total > 81.75) {printf ("%01.2f", $total * .11);}else {echo "8.99 ";}?>">
Any help much appreciated. Not a brand newbie but I'm still learning...
<?php if ($total > 81.75) {printf ("%01.2f", $total * .11);}else {echo "8.99 ";}?>
so far no luck - I can get the code to display on the page, but get parse errors when I try to put it in a hidden field
<input type="hidden" name="shipping" value="<?php if ($total > 81.75) {printf ("%01.2f", $total * .11);}else {echo "8.99 ";}?>">
Any help much appreciated. Not a brand newbie but I'm still learning...