I'm trying to make a filemanager in PHP, where it should be possible to delete files by checking some checkboxes in a form.
I use the name of the files as the checkbox name, and when the "delete" button in the form is pressed, the parameter f.ex. filename1.doc=on is send to the php page, which should take care of the deleting, if I have choosen to delete the file with the name filename1.doc.
In the page where I receive the parameter I have the following code:
$checkbox_name = "filename1.doc";
if ($_GET[$checkbox_name] == 'on' )
/* Do the deleting etc... */
The problem that this check is never true. But if I replace the '.' in the filename with f.ex. an 'a' or some other letter and make the following check where I receive the parameters:
$checkbox_name = "filename1adoc";
if ($_GET[$checkbox_name] == 'on' )
/* Do the deleting etc... */
..the check is performed ok. I also have the problem with spaces in the filename.
Is there some kind of string convert function in PHP, which can help me solve this problem, or do I manually have to make a string replace on all charecters, which apperently can't be used as a get/post parameter?