You are here: Problem Passing File Names « PHP Programming Language « IT news, forums, messages
Problem Passing File Names

Posted by Jacob Lyles on 11/18/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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация