Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how i multiple 3 field in php from drop menu

    thanks for this importent site

    i have recordset reding from mysql and i have repet region
    and i have for field Qty rent pe rday dropmenu for how many days and total how can i multiple when i select from drop menu directly qty * perday * days = total

    thank you so much

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    In PHP, post you're form than multiply from you're extracted $_POST superglobal.
    PHP Code:
    $total 0.0;
    if (isset(
    $_POST['qty']) && isset($_POST['days']) && isset($_POST['perday']))
    {
        
    $total = (int)$_POST['qty'] * (float)$_POST['days'] * (float)$_POST['perday'];

    Otherwise, use Javascript to do it inline.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #3
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for your help

    my problem if i want to select from drop menu the day directly multyply qty * perday * days = total

    thank you so much


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •