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...
Help with code in hidden field
Moderator: General Moderators
the code works, do not see any problem:
Code: Select all
<?php
$total=90;
?>
<form>
<input type="hidden" name="shipping" value="<?php if ($total > 81.75) {printf ("%01.2f", $total * .11);}else {echo "8.99";}?>">
</form>