Jump to content

help with drop down


fazzfarrell

Recommended Posts

Can any one help!

The Database:
mysql_select_db($database_jag, $jag);
$query_rsCurrency = "SELECT * FROM `currency`";
$rsCurrency = mysql_query($query_rsCurrency, $jag) or die(mysql_error());
$row_rsCurrency = mysql_fetch_assoc($rsCurrency);
$totalRows_rsCurrency = mysql_num_rows($rsCurrency);



The Drop down menu:
<form id="frmCurr" name="frmCurr" method="post">
<select name="Currency" id="Currency" OnChange="UpdateQuantity()">
<option selected="selected">GBP</option>
<option value="British Pounds">British Pounds</option>
<option value="American Dollars">American Dollars</option>
<option value="Euro">Euro</option>

</select>
</form>

The result
<?php
//Price x currency to give result
$number1 = $HTTP_SESSION_VARS["icJag"]->col("ItemSubTotal");
$number2 = $row_rsCurrency['Rate'];
$newnumber = ($number1 * $number2);
echo $english_format_number = number_format($newnumber, 2, '.', '');

?>



What I am trying to do is:
The user selects there currency
The price is in GBP on the page, when the uaer selects the currency it calculates the result on the page with out going to another page.

The url for the page is http://gtr.spgrouponline.co.uk/resul...mageField_y=10

As you can see I have a postage area option too this works fine and there are some results on the bottom right where the calculation works (as it is picking up the first option in the database)

Thanks
Link to comment
https://forums.phpfreaks.com/topic/24068-help-with-drop-down/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.