I want to write a php script, which lists all the items in the folder, where the php script is located/in the folder where it was started (except index.php)...
I got 2 Problems
1. ATM it is only listing the items in the folder "foobar"<br/>
2. It is not creating a new `<li>` Tag for every new items<br/>
This is my code so far...
<?php
$folder = openDir("foobar");
while ($file = readDir($folder)) {
if ($file != "." && $file != "..") {
echo "<!DOCTYPE HTML>
<html>
<head>
<title>nothing</title>
<link href='http://fonts.googleapis.com/css?family=Raleway:100' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Vollkorn:700' rel='stylesheet' type='text/css'>
<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />
</head>
<body>
<div id=\"title\">
<h1>nothing</h1>
</div>
<div id=\"main\">
<ul>
<li><a href=\"foobar/$file\">$file</a></li>
</ul>
</div>
</body>
</html>";
}
}
closeDir($folder);
?>