...

View Full Version : how i multiple 3 field in php from drop menu



imadsb
03-06-2009, 12:04 AM
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

Fou-Lu
03-06-2009, 12:08 AM
In PHP, post you're form than multiply from you're extracted $_POST superglobal.


$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.

imadsb
03-06-2009, 01:00 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum