Parse error:syntax error, unexpected ' "class_rect.php"
<title>The perimeter and area of the graph calculator</title>
Auto Load
Requireonce "class_rect.php";
Requireonce "class_triangle.php";
Requireonce "class_circle.php";
function __autoload ($className) {
Include ("Class_". Ucfirst ($className). ". PHP ");
}
?>
The perimeter and area of the graph calculator
Rectangle | |
Triangle | |
Circular
Switch ($_request["action"]) {
Case ' 1 ':
$form =new form ("Rectangle", $_request, "test.php");
Echo $form;
Break
Case ' 2 ':
$form =new form ("Triangle", $_request, "test.php", "post", "_blank");
Echo $form;
Break
Case ' 3 ':
$form =new form ("Round", $_request, "test.php");
Echo $form;
Break
Default
echo "Please select a shape
";
}
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);
Break
}
echo "Area:". $shape->area (). "
";
echo "Perimeter is:". $shape->perimeter (). "
";
}
?>
------to solve the idea----------------------
References:
<title>The perimeter and area of the graph calculator</title>
Auto Load
Require_once "class_rect.php";
Require_once "class_triangle.php";
Require_once "class_circle.php";
function __autoload ($className) {
Include ("Class_". Ucfirst ($className). ". PHP ");
}
?>
The perimeter and area of the graph calculator
Rectangular
------to solve the idea----------------------
Triangle
------to solve the idea----------------------
Circular
Switch ($_request["action"]) {
Case ' 1 ':
$form =new form ("Rectangle", $_request, "test.php");
Echo $form;
Break
Case ' 2 ':
$form =new form ("Triangle", $_request, "test.php", "post", "_blank");
Echo $form;
Break
Case ' 3 ':
$form =new form ("Round", $_request, "test.php");
Echo $form;
Break
Default
echo "Please select a shape
";
}
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);
Break
}
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)
{
。。。。。。。。
}