index.php

<?php

$files = glob('*');

?>
<!DOCTYPE html>
<html>
<head>
	<title>packy.se - source code</title>
	<script language="javascript" src="/prettify/prettify.js"></script>
	<link rel="stylesheet" href="/prettify/prettify.css" type="text/css" />
</head>
<body onload="prettyPrint()">


<?php if(empty($_GET['show'])) { ?>
<p>
	<ul>
<?php foreach($files as $file) { ?>
		<li><a href="?show=<?=$file?>"><?=$file?></a></li>
<?php } ?>
	</ul>
</p>
<?php } ?>

<?php if(in_array($_GET['show'], $files)) { ?>
<h3><a href="/code/">/code/</a> <?=$_GET['show']?></h3>
<pre class="prettyprint"><?=htmlentities(file_get_contents($_GET['show']))?></pre>
<?php } ?>


</body>
</html>