BlindLaby/list/index.php
2020-08-04 12:22:09 +02:00

29 lines
876 B
PHP

<?php
session_start();
$currentFile = !empty($_SESSION['file']) ? $_SESSION['file'] : null;
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="index.css" />
<style>
#board{width:300px;height:300px; margin:200px auto;}
#start{display:block;}
.current{background-color:yellow;}
</style>
</head>
<body>
<div id="board">
<?php
$folder =new DirectoryIterator('../custom/');
foreach($folder as $file){
if(!$file->isDir()){
echo '<a href="http://labs.shikiryu.com/experimental-games/2/?level='.substr($file->getFileName(), 0, -3).'" title="laby '.substr($file->getFileName(), 0, -3).'"';
if($currentFile !== null && $currentFile == $file->getFileName()) echo ' class="current"';
echo '>laby '.substr($file->getFileName(), 0, -3).'</a><br/>';
}
}
?></div>
</body>
</html>