0
我想編輯我的PHP腳本,這樣我添加到表單的價格將作爲總額添加,當用戶單擊提交時,但我不確定如何合計這些值。PHP:將價格添加到表格
HTML
<select name="service">
<option value="Yes" value="10">Yes £10</option>
<option value="No">No</option>
</select>
<form method="post" action="example.php">
<select name="booking">
<option value="Double Room" value="50">Double Room £50</option>
<option value="Twin Room" value="70">Twin Room £70</option>
<option value="Family Room" value="100">Family room £100</option>
</select>
<br /> <br />
<input type="submit" value="submit" action="example.php" name="submit"><br />
</form>
PHP
You have choosen the <?php echo $_POST["booking"]; ?>
添加了什麼?之前的值? – Rikesh 2013-03-12 16:35:17
沒有得到你?你想添加什麼?什麼? – 2013-03-12 16:35:42
也,您有2個「價值」參數爲您的每個選項... – nsheff 2013-03-12 16:38:26