can any one help me with this script I am just gettin started with PHP
I am trying to create an calculation script that would
calculate the
Constant: PI = 3.1415926535
Radius, area, and circumference of a circle .
this is what i have done with the script so far I am getting results, which is good but not
getting the calculation of the area and circumference of the circle
<html>
<head>
<title>
Calculation Form
</title>
</head>
<body>
<?php
if (!isset($POST['submit'])) {
$result = '<form action="" . method="post">' .
'<input type="text" name="radius" />' .
'<input type="submit" name="submit" value="Calculate" />' .
'</form>';
} else {
define('M_PI', '3.141....');
$circumference = M_PI $POST['radius'] 2;
$area = M_PI * pow($_POST['radius'], 2);
$result .= 'Circumference = ' . $circumference . ' units<br />';
$result .= 'Area = ' . $area . ' sq. units<br />';
print " $result";
}
?>
<html>
<head>
<title></title>
</head>
<body>
<p><? echo "$result" ; ?></p>
</body>
</html>
Do i have to define M_PI? to get the calculations.
thanks for the help