The perimeter and area of the graph calculator
The perimeter and area of the graph calculator
Rectangle | | Triangle | | Circular
";} if (Isset ($_request["Act")) {Switch ($_request["Act"]) {case ' 1 ': $shape =new Rect ($_request); Break;case ' 2 ': $shape = New Triangle ($_request); Break;case ' 3 ': $shape =new Circle ($_request); echo "Area:". $shape->area (). "
"; echo" perimeter is: ". $shape->perimeter ()."
";}? >
Reply to discussion (solution)
Requireonce should write
Require_once
No, it's not working, I've set up automatic loading
But it doesn't seem to be loading.
How can it be? You don't have to look at the first few lines of error!
Require_once "class_rect.php"; Require_once "class_triangle.php"; Require_once "class_circle.php";
The perimeter and area of the graph calculator
The perimeter and area of the graph calculator
Rectangle | | Triangle | | Circular
";} if (Isset ($_request["Act")) {Switch ($_request["Act"]) {case ' 1 ': $shape =new Rect ($_request); Break;case ' 2 ': $shape = New Triangle ($_request); Break;case ' 3 ': $shape =new Circle ($_request); echo "Area:". $shape->area (). "
"; echo" perimeter is: ". $shape->perimeter ()."
";}? >
The perimeter and area of the graph calculator
The perimeter and area of the graph calculator
Rectangle | | Triangle | | Circular
";} if (Isset ($_request["Act")) {Switch ($_request["Act"]) {case ' 1 ': $shape =new Rect ($_request); Break;case ' 2 ': $shape = New Triangle ($_request); Break;case ' 3 ': $shape =new Circle ($_request); echo "Area:". $shape->area (). "
"; echo" perimeter is: ". $shape->perimeter ()."
";}? >
The error here is to show that $_request["action" does not exist, without this index
You need to decide if it's empty.
$action = Isset ($_request["action"])? $_request["Action"]: "; switch ($action) {//..... }