IS 337: Website Administration

Lecture for November 12: Data from XML

+
-

Topics

Quick Topic: Captcha

Urlacher with XML

  • Hodgepodge #1: PHP errors toggle
    • tail -f error_log
    • ^C
  • Hodgepodge #2: "Previously, on IS 337..." toggle
    • Price looked like a float; didn't compute like one
    • Look at print_r() output.
    • Don't have the data we think we have.
    • Now and future: clean data immediately when read in.
  • Hodgepodge #3: Bare beginnings of templating toggle
    • Much (most?) content is repeated on each page.
    • Abstract the content into print functions.
    • Makes it easier to change the common content.
    • Now: abstract "welcome, bob" message to be used on all pages.
    • Future: more abstraction.
    • Future: use an off-the-shelf solution.
  • Hodgepodge #4: Formatting for money toggle
    • number_format()
    • money_format()
  • Hodgepodge #5: More SimpleXML toggle
    • Magic!

Readings and Resources

Quick Written Assignment for Next Time

Write a version of money($amount) that uses money_format() instead of number_format(). (This is, perhaps, more an exercise of searching the PHP manual.)

Creative © 2007 Calvin College and Jeremy D. Frens.
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.