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

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

03-06-2009, 01: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.

03-06-2009, 02: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