Back to DFS's Workshop Page
Back to Agenda Page
Rectangle Problem I
For this problem, you are to cannibalize any available code and write a pair of scripts which will do the following.
- The HTML Page: rectask.html
- Ask the user for the dimensions of a rectangle
- Accept input in a form
- Using the Calculate button, send the data to a PHP script called rectcalc.php
- The PHP Script: rectcalc.php
- Check the data received to ensure that the values are possible; use die or exit to report problems and terminate execution
- Check the length and the width and swap the values if necessary
- Report the actual length and width
- Calculate and report the perimeter, diagonal and area of the rectangle
- Calculate and report the area of the largest circle which will fit inside the rectangle
To see how this could work, view this possible solution.
© 2003-2005 DFStermole
Created 5 May 03
Last Modified 13 Nov 05