Dear Reilly Miller,
Here's the content of calculate_form.html and calculate.php
calculate_form.html
<HTML>
<HEAD>
<TITLE>Calculation Form</TITLE>
</HEAD>
<BODY>
<FORM METHOD="post" ACTION="calculate.php">
<P>Value 1: <INPUT TYPE="text" NAME="val1" SIZE=10></P>
<P>Value 2: <INPUT TYPE="text" NAME="val2" SIZE=10></P>
<P>Calculation:<br>
<INPUT TYPE="radio" NAME="calc" VALUE="add"> add<br>
<INPUT TYPE="radio" NAME="calc" VALUE="subtract"> subtract<br>
<INPUT TYPE="radio" NAME="calc" VALUE="multiply"> multiply<br>
<INPUT TYPE="radio" NAME="calc" VALUE="divide"> divide</P>
<P><INPUT TYPE="submit" NAME="submit" VALUE="Calculate"></P>
</FORM>
</BODY>
</HTML>
caculate.php
<?
if (($_POST[val1] == ""
|| ($_POST[val2] == ""
|| ($_POST[calc] == ""
) {
header("Location: calculate_form.html"
;
exit;
}
if ($_POST[calc] == "add"
{
$result = $_POST[val1] + $_POST[val2];
} else if ($_POST[calc ] == "subtract"
{
$result = $_POST[val1] - $_POST[val2];
} else if ($_POST[calc ] == "multiply"
{
$result = $_POST[val1] * $_POST[val2];
} else if ($_POST[calc ] == "divide"
{
$result = $_POST[val1] / $_POST[val2];
}
?>
<HTML>
<HEAD>
<TITLE>Calculation Result</TITLE>
</HEAD>
<BODY>
<P>The result of the calculation is: <? echo "$result"; ?></p>
</BODY>
</HTML>
I run it from serveral of my hosting sites and it works. It only doesn't work with WAMP. It doesn't work the result at all. All it does is showing "The result of the calculation is" and that's it.
Thank you for your help,
Regards,