Hi
I'm trying to figure out how to <input> $radius
and echo $pi
without using a DB.
This is a simple example how this calculate $pi
which you can run and see how it works:
<?php
$pi = "3.1415927";
$radius = 8;
echo $pi * ($radius * $radius);
?>
The past few days I been trying to figure out how to <input> $radius
and then calculate $pi
in a different page:
This is my form:
<html>
<body>
<form action="radius.php" method="get">
$radius: <input type="text" name="radius" /><br />
<input type="submit" value="Submit">
</form>
</body>
</html>
This is my radius.php
, this where it does the calculation:
<?php
$pi = "3.1415927";
$radius = ' ';
?>
This is my output:
<?php echo $pi * ($radius * $radius); ?>
I appreciated any suggestions or comments and also let me know what I did wrong or I might overlook something.
Thanks!