CLEAR! (start over)
Click Here to Begin: PHP Beginner Tutorial
Click Here for Line-Wrapped PHP Source Code
or Click Here for Context-Highlighted Code
Right Click to Download Lesson Text File
ARChive: Apotheonic Resource Collection

<?php
  require_once('http://arc.apotheon.org/dtd.inc');
?>
<head>
  <title>sample PHP page</title>
  <?php
    require_once('http://arc.apotheon.org/styles.inc');
  ?>
</head>
<body>
<?php
  require_once('http://arc.apotheon.org/ad.inc');

  $content = $_GET['content'];      // there was a time this wasn't necessary

  $ext = '.txt';
 
  echo '<p style="border-bottom: thin solid black">
  <a href="./php.php"><strong>CLEAR!</strong></a> (start over)<br />
  Click Here to Begin: <a href="./php.php?content=phpbegin"><strong>PHP Beginner Tutorial</strong></a><br />
  Click Here for <a href="./php.php?content=php"><strong>Line-Wrapped PHP Source Code</strong></a><br />
  or Click Here for <a href="./php.php?content=context"><strong>Context-Highlighted Code</strong></a><br />
  <a href="./phpbegin.txt">Right Click to Download Lesson Text File</a><br />
  <a href="http://arc.apotheon.org"><strong>ARChive: Apotheonic Resource Collection</strong></a>
</p>

';
 
  if ($content == 'php') {
    $ext = '.php';
  }
 
  echo '<tt>
';

  if ($content == 'context') {
    show_source('php.php');
  } elseif ($content) {
    $mainstuff = file($content.$ext);
    $mainstuff = join('', $mainstuff);
    echo preg_replace('/  /', '&nbsp; ', nl2br(htmlspecialchars($mainstuff)));
  } else {
    echo "<p class=\"explain\">Don't click on the source code link until you're ready for it.  That's an answer to the \"assignment\" in the beginner tutorial.  The good stuff is under the beginner tutorial link.</p>

<p class=\"explain\">Now for the explanation: This is a PHP tutorial for people new to PHP, but not to programming in general.  This tutorial also assumes you are familiar with XHTML and the way it is rendered by a browser.  Hopefully, if that describes you, you'll find it useful.  The beginner tutorial link is the actual lesson, and the source code link is a solution to the practice \"assignment\" described in the lesson.</p>";
  }

  if ($content == 'phpbegin') {
    echo "<br /><br />";
    echo "#####<br />";
    echo "NOTES:";
    echo "<ol>";
    echo "  <li><a href=\"http://www.toykeeper.net/soapbox/php_problems/\">PHP Problems</a></li>";
    echo "  <li><a href=\"http://sob.apotheon.org/?p=224\">POOHP</a></li>";
    echo "</ol>";
  }
 
  echo '
</tt>
';
?>
</body>
</html>