我無法創建選項並將它們與表單一起發佈。HTML下拉菜單和php動態創建
這是我目前有。數據庫連接器已經在工作。
<select class="form-dropdown validate[required]" style="width:150px" id="input_5" name="account">
<?php
while($row = mysql_fetch_row($result)){
$bid =$row[0];
$account = $row[1];
echo '<option value="'.$bid.'>"'.$account.'"</option>"';
}
?>
</select>
它不會發布到:
function calculateBilling(){
$date = date('mdY');
$bid = mysql_real_escape_string($_POST['bid']);
$account = mysql_real_escape_string($_POST['account']);
$timein = mysql_real_escape_string($_POST['timein']);
$desc = mysql_real_escape_string($_POST['desc']);
$hrs2calc1 = mysql_real_escape_string($_POST['hrly']);
$hrs2calc2 = mysql_real_escape_string($_POST['rhrly']);
$query = 'SELECT bid, account, hrly, rhrly, bal FROM billing WHERE bid="'.$bid.'"';
echo $query;
$result = mysql_query($query);
while($row = mysql_fetch_row($result)){
$accounttobebilled = $row[1];
$first = $row[2];
$second = $row[3];
$curbal = $row[4];
}
$sub1 = $hrly * $hrs2calc1;
$sub2 = $rhrly * $hrs2calc2;
$subtotal = $sub1 + $sub2;
$total = $curbal + $subtotal;
mysql_query("UPDATE billing SET bal = '" . $total . "' WHERE bid ='" . $bid . "'");
// Update Billing Log for this customer
mysql_query("INSERT INTO billingLog (bid, date, hrsOnsite, hrsRemote, timein, descript, total) VALUES ('$bid', '$date', '$hrs2calc1', '$hrs2calc2', '$timein', '$desc', '$subtotal')");
}
我的問題是計費ID(BID)不與它被包裹的形式張貼沿着如果我贊同在HTML頁面上$競價。在我發佈之前,它很好。它只是不會發布到上面的功能。出價是一個整數。
謝謝!
你能提供輸出的HTML嗎? –
更新的問題 –