I wrote a program for calculating the graphic area according to the book, but did not perform the calculation. I would like to know where the error occurred.
Source: Internet
Author: User
I wrote a program for calculating the graphic area according to the book, but did not perform the calculation. what is the last example of the error in chapter 8th of php. You can create a form, but an error occurs after you click calculate. Could you kindly advise the interface: class _ Shape. php & lt ;? Php & nbsp;
The last example in chapter 8th of php. You can create a form, but an error occurs after you click calculate. Thank you!
Interface: class _ Shape. php
Interface Shape {
Function area ();
Function perimeter ();
}
?>
Rectangle: class _ Rect. php
Class Rect implements Shape {
Private $ width;
Private $ length;
Switch ($ this-> request ["action"]) {
Case 1:
$ Str. ="Rectangular length:";
$ Str. =" Request ["length"]. ">";
$ Str. ="Rectangle width:";
$ Str. =" Request ["width"]. ">";
Break;
Case 2:
$ Str. ="Triangle side length 1:";
$ Str. =" Request ["length1"]. ">";
$ Str. ="Triangle side length 2:";
$ Str. =" Request ["leng2"].">";
$ Str. ="Triangle side length 3:";
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.