<html>  
 <body>       
 <form action="hesapla.php" method="POST">           
 <label>Daire Yarıçapı:</label>
 <input name="r"></input>          
<input name="submit" type="submit" value="Hesapla">
</div>
</form> 
</body>
</html>

<?php
function hesapla($r)
{
    $pi = 3.14;
    $alan = $r*$r*$pi;
    return $alan;
}
$r = $_POST["r"];
if(!empty($r))
{
    echo "Yaricap: ",$r,"<BR>";
    echo "Alan:",hesapla($r);
}
else
    echo "Yaricap bos birakilamaz.";
?>