🎉 Hello world (finally)!
This commit is contained in:
29
list/index.php
Normal file
29
list/index.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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>
|
Reference in New Issue
Block a user