im working on a upload script and i want it to put out all files that are in a certain directory...
heres the code i got now:
echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\">";
if ($admindir = opendir('$path')) {
while (false !== ($admindir_files = readdir($admindir))) {
if ($admindir_files != "." && $admindir_files != "..") {
echo "<tr><td>$admindir_files</td><td><a href=\"?id=rename&pass=$pass\">Rename</a></td><td><a href=\"?id=delete&pass=$pass\">Delete</a></td></tr>\n";
}
}
closedir($admindir);
}
echo "</table>";
ok $path is set to uploaded..ie:
$path = "uploaded";
uploaded is the folder that the files are uploaded to, but when i want to use that code that i have up there i get the following error:
Warning: opendir($path): failed to open dir: No such file or directory in /home/stoopid/public_html/beta/RSupload/RSupload.php on line 136
but when i replace $path with its value...ie:
echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\">";
if ($admindir = opendir('[b]uploaded[/b]')) {
while (false !== ($admindir_files = readdir($admindir))) {
if ($admindir_files != "." && $admindir_files != "..") {
echo "<tr><td>$admindir_files</td><td><a href=\"?id=rename&pass=$pass\">Rename</a></td><td><a href=\"?id=delete&pass=$pass\">Delete</a></td></tr>\n";
}
}
closedir($admindir);
}
echo "</table>";
it works just fine...but i rather have it do the folder that $path has....can anybody help?
thanks