This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
PHP - multiplying variable by 5
Started 15 years ago by neilo | 3 posts |
-
Again, something beyond the scope of this forum, I admit, but this would put the icing on the cake of my form-to-PayPal process.
I have - with the help of this forum - arranged that a number submitted in the form (the number of entries into the charity's
competition) is returned in my redirect page as a session variable. Each entry costs £5.00, so I want to be able to multiply the
session variable (element_8) by 5. This will enter the total cost into the PayPal form. I have no idea of the correct syntax to use.
The line I have is:
<input type='hidden' name='item_price' value='<?php echo ''. $_SESSION['form_data']['element_8']; ?>'>
I would like it to submit element_8 times 5
(No worries if this is beyond the scope of support for this product)
Thank you.
Posted 15 years ago # -
You can try this:
<input type='hidden' name='item_price' value='<?php echo ''. $_SESSION['form_data']['element_8'] * 5; ?>'>
MachForm Founder
Posted 15 years ago # -
Again, thank you, - works perfectly.
Posted 15 years ago #
Reply
You must log in to post.