function generatePage() { $page = ""; $page = $page . htmlStart(); $page = $page . "Dies ist meine Seite!"; $page = $page . htmlStop(); return $page; }
<?php include_once "../lib/htmlHelper.php"; include_once "../lib/db.php"; echo htmlStart("Clockwork design -- Michael Telford"); # This is the array of links that will be on this page $links = array("Home" => "index.php", "Galleries" => "galleries.php", "About me" => "about.php", "Contact Information" => "info.php"); heading("Home page"); #echo out the links echo genLinks($links); echo "<div id='main'>\n"; $db = new db("site", "localhost", "mike", "default"); #get the 4 most recient posts $db->query("SELECT title, description, image, created FROM post ORDER BY created LIMIT 4"); while ($line = $db->fetchNextObject()) { # we now have the results in the form $line->field $img = $line->image; $title = $line->title; $desc = $line->description; $time = $line->created; # echo time echo <<<SINGLEPOST <div class='post'> <img src='{$img}' /> <h3>{$title}</h3> <p>{$desc}</p> <p>{$time}</p> </div> SINGLEPOST;
<?php htmlStart(); ?> <head> <style type="text/css"> .cssClassA{ width: 100px; border: dashed; } .cssClassB{ width: 100px; border: dotted; } </style> </head> <?php htmlBodyStart(); formStart(); getTextField(); echo getTextFieldV1('First Name', 'fname'); echo getTextFieldV1('Last Name', 'lname'); echo getTextFieldV2('Phone 1', 'phone1', 'cssClassA'); echo getTextFieldV3('Phone 2', 'phone2'); echo getTextFieldV3('City', 'city', 'cssClassA');