Parse error:syntax error, unexpected ' "class_rect.php"

Source: Internet
Author: User
 
  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) {//..... }
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.