I'm trying to pass values with special characters through a url, and then read the value which corresponds to a directory in Linux.
By special characters I mean spaces, apostrophes, ampersand and the like.
So, I'm doing something like this.
// my folder structure is
// index
// ->folder 1
// ->folder's
// read index to get folder names
$mydir = dir($directory);
....
// pass the folder name as a group name
echo <a href=\"images.php?page=1&group=$group\">
// So far, the special characters still exist ie:
echo $group[1] // output's "folder's"
The reading page grabs the group and tries to read the folder it represents in Linux
$group = $HTTP_GET_VARS['group'];
$mydir = dir($group);
// At this point, the script breaks and it says
Warning: dir(/public_html/index/folder's/): failed to open dir: No such file or directory in /public_html/images.php on line 53
Fatal error: Call to a member function on a non-object in /public_html/images.php on line 54