|
Posted by Jacob Lyles on 10/09/02 11:43
Hello,
I'm using the following function to display a list of files in a
directory in a HTML form that allows the user to delete files. Look at
the echo line. The links work fine, taking a user to
../directory/file.extention as expected. However, the value in the name
field of the input tag gets passed through POST as
/_/directory//file_extention, which messes up my unlink function. The
strange thing is I'm using \"/$dir/$file\" for both of them, so POST
must be doing something to my string.
function checklist_dir($dir) {
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (filetype($dir . $file) != dir) {
echo "<input type=\"checkbox\" name=\"/$dir/$file\" /><a
href=\"/$dir/$file\">$file</a><br />";
}
}
closedir($dh);
}
}
}
Any help would be appreciated.
Thanks,
Jacob
[Back to original message]
|