MMDT1146 PHP Programming
Week 11


Week 11

Notes:

  • The gif graphic format has now been brought back into php installations now that the gif encoding patent has expired.  New installations of php currently support the gif graphic format.
  • Be absolutely sure to use "imagedestroy()" before you exit the script.  Forgetting to do this will eventually lock up the server.
  • Test of the GD library graphics capabilities installed on the server.

Lab 11

This lab is to test your knowledge of being able to generate dynamic graphics using php.

You may use these gauge graphics as a starting point, or you may use your own.

The lab must contain several items.  Your resulting output should like similar to this.

Create a subfolder on your web server named "weather".  (This may already be done for you from doing the in class exercise.)

Generate a thermometer graphic that represents the current temperature.  The graphic should be a png format.    In the graphic, also display the current temperature in numerical format as well.  In my example I did it in the "bulb" area of the graphic. 

Generate a humidity gauge graphic that represents the current humidity.  The graphic should be a png format.    In the graphic, also display the current humidity in numerical format as well.  Display the graphic on the page. 

Generate a barometer graphic that represents the current barometric pressure.  The graphic should be a png format.    In the graphic, also display the current barometric pressure in numerical format with two decimal points as well.  Display the graphic on the page. 

Extra Credit:  instead of using the imagefilledarc() function, convert from polar to rectangular coordinates and then use a imageline() function instead.  The result looks cleaner.

Assignment is due 1 week from when it was assigned.  50% penalty if late.

MMDT 1146 Lab 11
Grading Criteria
Date
Possible
Points
15
Your
Points
15
Thermometer graphic displayed with correct indication. 3 3
Temperature in numerical format displayed. 2 2
Humidity gauge graphic displayed with correct indication. 3 3
Humidity in numerical format displayed. 2 2
Barometer graphic displayed with correct indication. 3 3
Barometric pressure displayed in numerical format two dec points. 2 2

Extra credit - convert from polar to rectangular coordinates so that a line can be drawn instead of an arc for the humidity and barometer gauges. 5 5