<?php

// showfiles.php
// by Daniel Lyons

// this unset prevents "register_globals" attacks, Bill and I think.
unset ($files);

// we use this array to ensure that the file requested is valid.
// Jarrod: you're going to have to add files to this array whenever you update
// the directory if you want people to be able to see 'em
$files = array('spam.txt', 'publications.txt', 'wanted.txt', 'CondolezzaRice.txt', 'frpba.txt', 'thanksgiving.txt', 'peoplepoll.txt');

// if we don't have an argument named 'file', or if that argument doesn't name a
// file listed in the array above, show them the "fuck off" page
if (!isset($_GET['file']) || !in_array($_GET['file'], $files))
{
  header("HTTP/1.0 403 Forbidden");
  include('forbidden.html');
  exit();
}

?>

<html>
	<head>
		<title><?= $file ?></title>
		<link rel="stylesheet" href="bonw.css">
	</head>
	<body>
		<pre>
<? include ($_GET['file']) ?>
		</pre>
	</body>
</html>
