In client.php I have combobox and text field.

- Code: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Client</title>
</head>
<body>
<div style="width: 800px; margin: 0px auto; padding-top: 80px;">
<form name="form" method="post" action="wsdl.php">
<label style="font-weight: bold">Choose option and enter number:</label>
<br>
<input type="int" name="number">
<select name="option_menu">
<option value="0" selected="selected">Option</option>
<option value="1300">option 1</option>
<option value="1400">option 2</option>
<option value="1600">option 3</option>
<option value="1800">option 4</option>
</select>
<input name="calculate" type="submit" value="Calculate">
</form>
</div>
</body>
</html>
When someone chooses option 3 for example, I need to extract its value 1600 and multiply it by number entered in text field. This should be done in function calculate($opt_value,$num) which is in service.php file, but I can't do that because I don't know how to extract that value to wsdl.php file.
I guess this is wrong in wsdl.php file:
- Code: Select all
if(isset($_POST['calculate'])){
$param = array("opt_value" => $_POST["option_menu"], "num" => $_POST["number"]);
$result = $client->call('calculate', $param);
Or maybe its the function in service.php file:
- Code: Select all
$server->register('calculate', array('opt_value' => 'xsd:int', 'num' => 'xsd:int'), array('return' => 'xsd:int'), 'urn:Result');
function calculate($opt_value, $num) {
$result = $opt_value * $num;
return $result;
}
As you can probabily see I am new to this php stuff so I was wondering if anyone can help me out?

