User Tools

Site Tools


eg-259:lecture16

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
eg-259:lecture16 [2012/03/13 19:55] – [First PHP Example] eechriseg-259:lecture16 [2013/03/08 18:03] (current) – [Introduction to PHP (Part 1)] eechris
Line 2: Line 2:
 ====== Introduction to PHP (Part 1) ====== ====== Introduction to PHP (Part 1) ======
  
-**Contact Hour 19**: To be discussed on Tuesday 20th March, 2012.+**Supplementary Material** 
 + 
 +Provided for Reference. This material is no longer taught on this module.
  
 **Lecturer**: [[C.P.Jobling@Swansea.ac.uk|Dr Chris P. Jobling]]. **Lecturer**: [[C.P.Jobling@Swansea.ac.uk|Dr Chris P. Jobling]].
Line 368: Line 370:
   * Code:   * Code:
 <code php> <code php>
-<?php echo("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); ?>  +<!DOCTYPE html>
-<!DOCTYPE html PUBLIC "-//w3c//DTD HTML 1.1 //EN" +
- "http://www.w3.org/TR/HTML11/DTD/HTML11.dtd">+
  
 <!-- powers.php <!-- powers.php
      An example to illustrate loops and arithmetic      An example to illustrate loops and arithmetic
      -->      -->
-<html xmlns = "http://www.w3.org/1999/HTML" xml:lang="en"> +<html lang="en"> 
-  <head> <title> powers.php </title>+  <head>  
 +    <meta charset="utf-8"> 
 +    <title> powers.php &ndash An example to illustrate loops and arithmetic </title>
   </head>   </head>
   <body>   <body>
Line 401: Line 403:
     </table>     </table>
   </body>   </body>
-</html> +</html> 
 </code> </code>
  
Line 433: Line 436:
 ---- ----
  
-<note>+<note warning>
 this is not necessarily a good idea! Notice how the end brace for the conditional is separated from the loop body by several unrelated HTML tags. This produces fragile code -- if the second set of PHP tags where removed, a syntax error would occur which might be difficult to track down. this is not necessarily a good idea! Notice how the end brace for the conditional is separated from the loop body by several unrelated HTML tags. This produces fragile code -- if the second set of PHP tags where removed, a syntax error would occur which might be difficult to track down.
-</code>+</note>
  
  
eg-259/lecture16.1331668539.txt.gz · Last modified: 2012/03/13 19:55 by eechris