Potreste per favore dirmi perchè la variabile area non passa tra i due script che allego:
Codice PHP:
<!DOCTYPE html>
<html>
<head>
<title>Immissione area</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form action="calarea.php" method="post">
<div>
Area:
<input type ="text" name = "area">
<input type="submit" value ="Calcola">
</div>
</form>
</body>
</html>
e
Codice PHP:
<?php
class superficie
{
private $a;
public function __construct($area) {
$this->a =$area;
}
public function raggio(){
$r=sqrt($a/pi);
return $r;
}
}
?>
<html>
<head>
<title>Risultato</title>
</head>
<body>
<?php
$sup = new superficie($_REQUEST[area]);
echo ("Il raggio è " . $sup->raggio());
?>
</body>
</html>
Il secondo script, dopo che ho immesso un valore e dato il submit al primo mi genera una pagina completamente bianca.
Grazie.