<?php
  include("html_functions.php");

  include($_SESSION['adminpath']."/dbopen.php");

  if ($_SESSION['user_is_commish']!=1) {echo "You must be a commisioner to access this page";exit;}

  $page=$_GET['page'];
  if ($page=="") {echo "You must enter a page as 'pgViewer.php?page=page.php'";exit;}

  $fpath="./".$page;	
  if (file_exists($fpath))
  {
    $f = fopen($fpath,'r');
    if ($f)
     {
       while (!feof($f))
        {
          $text=fgets($f);
 	  $text=explode("\n",$text);
	  $text=htmlspecialchars($text[0]);
	  echo $text."<br/>\n";
        }
       fclose($f);
     }
  }

?>
