i assume you are passing your parameters as GET requests like script.php?file=this & that.mp3
first be sure you check your input really well, so users can't delete arbitrary files. second: encode your filenames with urlencode
when creating the link. the encoded char for &
is %26
.
your script would be called like this then: script.php?file=this%20%26%20that.mp3
(%20
being a whitespace)
otherwise you will have another GET variable, namely that.mp3
, being not assigned. &
is used to separate single parameters in your GET request
edit
a question from my side: how do you delete your files? using php’s unlink
function? or using exec
and calling rm
on your system? (which is generally very unsafe). if you’re doing it the second way you could use escapeshellarg
. if you don’t escape your shell input, your shell will interpret your command as two commands (afaik, don’t take my word for it)