IS 337: Website Administration

Lecture for October 22: PHP

+
-

Topics

Structure of a PHP Page

  • Write an (X)HTML page; give it a .php extension (not .html).

Real Structure of a PHP Page

  • See above.
  • Embed PHP in (X)HTML document toggle
    • <?php ... ?>
    • <script language="php">...</script>
    • <? ... ?>, <?= ... ?>
    • <% ... %>, <%= ... %>
  • echo and print

Programming in PHP

  • Comments: C style, shell style
  • for loop
  • integers and arithmetic
  • variables toggle
    • stupid sigil
    • untyped
    • undeclared (often)

Quick Written Assignment for Next Time

Write a PHP loop to print out the squares of 1 through 103 in an unordered list.

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.