1. This webservice is working converting the values from the select inputs "FromCurrency" and "ToCurrency" on the action page. The value is calculated fine and output asWhat I am trying to do is to multiply the $fConversionRate value on the action page by the form field valuetoconvert which I believe will appear as the following on the action page:PHP Code:echo $fConversionRate;
I have tried various combinations along the lines of ( conversionrate * valuetoconvert) but it doesn't seem to work. How can I output this value please do that please?PHP Code:$_GET['ValuetoConvert']
2. I could harcode the values into the FromCurrency and ToCurrency select drop downs but would rather output them from the webservice. How can I do that? Thank-you.
Attached is the zip with the lib folder needed to make the nusoap webservice work if you want to see how it works on you local machine,. Thanks again
Action page ws.phpPHP Code:<?php
require_once 'lib/nusoap.php';
$oClient = new nusoap_client(
'http://www.webservicex.net/CurrencyConvertor.asmx?WSDL',
TRUE // Needs to be TRUE because we are using WSDL
);
?>
<form action="ws.php" method="get">
<p>
Convert from:
<select name="FromCurrency">
<option value="USD">UnitedStatesDollar</option>
</select>
</p>
<p>
convert to:
<select name="ToCurrency">
<option value="CAD">CanadianDollar</option>
</select>
</p>
Value to convert:<input type="text" name="ValueToConvert" /><br />
<input type="submit" />
</form>
PHP Code:<?php
require_once 'lib/nusoap.php';
$oClient = new nusoap_client(
'http://www.webservicex.net/CurrencyConvertor.asmx?WSDL',
TRUE // Needs to be TRUE because we are using WSDL
);
$oResponse = $oClient->call(
'ConversionRate',
array(
'FromCurrency' => $_GET['FromCurrency'],
'ToCurrency' => $_GET['ToCurrency']
)
);
$fConversionRate = (float) $oResponse['ConversionRateResult'];
echo $fConversionRate;
?>
<!--output all vars to see what is going on
<?php
$vars = get_defined_vars();
print_r($vars);
?>-->






Bookmarks