Dissonance
Technical User
Anyways, so I want to display a directory listing, but I don't want/need the data about the parent folders. It's for a simple link script, so I can throw a bunch of stuff in a folder, and have my web page automatically link it. (I don't like the one build in to apache) Anyways, it's giving me an error, and I can't figure out why.
It's throwing this error to me, and I don't get it, it doesn't make any sense at all.
Code:
<?php
$folder = './'; //define which dir you want to read
$dir = opendir($folder); //open directory
while ($f = readdir($dir)) { //read one file name
if ($f = "../") {
echo "<br>";
} elseif ($f = "./") {
echo "<br>";
} else {
echo "<center><a href=\"$f\">$f</a><br>\n";
}
?>
It's throwing this error to me, and I don't get it, it doesn't make any sense at all.
Code:
Parse error: parse error, unexpected $ in /home/kyminitr/public_html/gallery/config.php on line 12