Hi, I am creating a dynamic filesystem for my very small web hosting company. It uses a username cookie to access a specific folder and for the life of me i cannot make the \ at the end of the file paths work correctly without sending it on a none existant file path. PLEASE HELP!!
$folder=$_COOKIE['username'];
$path="C:\Program Files\Cerberus\FTP Clients\.".$folder;
$dir_handle= opendir($path) or die("Unable to open FTP client");
Dynamic Filesystem: problem with --> / in file paths
Moderator: General Moderators
A \ is also an escape character, so it needs to be escaped...
I believe that should work for you. I haven't ran across this in ages though, as I don't run scripts in windows.
Code: Select all
$folder=$_COOKIE['username'];
$path="C:\\Program Files\\Cerberus\\FTP Clients\\".$folder;
$dir_handle= opendir($path) or die("Unable to open FTP client");