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


  1. neilo
    Member

    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 #
  2. yuniar

    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 #
  3. neilo
    Member

    Again, thank you, - works perfectly.

    Posted 15 years ago #

RSS feed for this topic

Reply