I am a newer of PHP....
My operation system is Window 2000. After I executed the files as following, some problems comes up...
--------------------------------------------------------------
first page: calculate_form.htm
<html>
<head>
<title> calculation form </title>
</head>
<body>
<form method="post" action="calculate.php">
<p>Valuel: <input type="text" name="val1" size=10></p>
<p>Value2: <input type="text" name="val2" size=10></p>
<p> Calculation:<p>
<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<br>
<p><input type="submit" name="submit" value="calculate"></p>
</form>
</body>
</html>
------------------------------------------------------------------
second page: calculate.php
<?php
if ($calc=="add") {
$result=$val1+$val2;
} else if ($calc=="subtract") {
$result=$val1-$val2;
} else if ($calc=="multiply") {
$result=$val1*$val2;
} else if ($calc=="divide") {
$result=$val1/$val2;
}
?>
<html>
<body>
<?
echo "Result is: $result";
?>
</html>
</body>
-----------------------------------------------------------------
Then there are some error messages:
Notice: Undefined variable: calc in c:\inetpub\wwwroot\phptest\calculate.php on line 2
Notice: Undefined variable: calc in c:\inetpub\wwwroot\phptest\calculate.php on line 4
Notice: Undefined variable: calc in c:\inetpub\wwwroot\phptest\calculate.php on line 6
Notice: Undefined variable: calc in c:\inetpub\wwwroot\phptest\calculate.php on line 8
fasdfa
Notice: Undefined variable: result in c:\inetpub\wwwroot\phptest\calculate.php on line 18
Result is:
-----------------------------------------------
Any idea about this error messages?
Please help!!!! I appreciate
Winter