Browse Source

Adding index file that checks if there are any bib files.

pull/14/head
Luis J. Villanueva 11 years ago
parent
commit
907ccf1230
  1. 26
      index.php

26
index.php

@ -0,0 +1,26 @@
<?php
#From http://stackoverflow.com/a/15774700
echo "<html>
<body>
<h3>Available databases:</h3>";
echo "<ul>";
$i = 0;
if ($handle = opendir('.')) {
while (false !== ($entry = readdir($handle))) {
if (strpos($entry,'.bib')) {
echo "<li><a href=\"bibtexbrowser.php?bib=$entry\">$entry</a></li>\n";
$i++;
}
}
closedir($handle);
}
if ($i == 0){
echo "<p><strong>ERROR: </strong>No .bib files were found</p>";
}
echo "</ul>
</body>
</html>";
?>
Loading…
Cancel
Save