Discuss and Contribute' . newline(); function createForm($type) { $output = ""; $type = preg_replace('#[^a-z]#i', ' ', $type); // just in case $type = substr_replace($type, strtoupper(substr($type, 0, 1)), 0, 1); $type = substr($type, 0, strlen($type) - 1); // following script uses PHP variables, so is not linked externally $output .= << HEREDOC; return $output; } function grabReports($type, $title) { $output = ""; $type = preg_replace('#[^a-z]#i', ' ', $type); // just in case $output .= tab(5) . "

$title

" . newline(); $output .= tab(5) . "" . newline(); return $output; } $id = trimRequest($_GET["req"]); switch($id) { case "comments": echo grabReports($id, "Comments, Questions, and Suggestions"); echo createForm($id); break; case "reports": echo grabReports($id, "Bugs, Errors, and Quirks (oh my)"); echo createForm($id); break; default: foreach (array("comments", "reports") as $i) { $r = glob("./inc/$i/*.txt"); $r = is_array($r) ? count($r) : 0; $$i = $r; } $cPlural = ($comments == 1) ? "item" : "items"; $rPlural = ($reports == 1) ? "item" : "items"; echo <<
  • Comments, Questions, and Suggestions ($comments $cPlural)
  • Bugs, Errors, and Quirks (oh my) ($reports $rPlural)
  • HEREDOC; } include_once('./_endpage.php'); ?>