arbitter Posted March 24, 2010 Share Posted March 24, 2010 Hello, I would like to make folders with a space in it (in DirectAdmin). Now the problem is when I do this, I can't do anything with the file, can't reset the owner, can't rename it, can't delete it, can't put somthing in it, ... Managed to delete them via an FTP client. Why do I want this? http://www.fransdepypere.be/uploads/uploads.php Here you can see on the left hand months with according years. It's put together like this: $dirs = glob('*',GLOB_ONLYDIR|GLOB_NOSORT); foreach($dirs as $dir) { $sortedDirs[filemtime($dir)] = $dir; } foreach (($sortedDirs) as $map) { $qmap = urlencode($map); if(isset($_SESSION['sort'])){ echo "<tr><td colspan='2' bgcolor='white' width='200' align='center' valign='middle' style='cursor:pointer' onclick=\"location.href='?month=$qmap&sort=$sort'\"><center>$map</center></td></tr>";} else{echo "<tr><td colspan='2' bgcolor='white' width='200' align='center' valign='middle' style='cursor:pointer' onclick=\"location.href='?month=$qmap&sort=ksort'\"><center>$map</center></td></tr>";} } Is there a simple solution to this? edit: You don't need to look at the sorting types Quote Link to comment https://forums.phpfreaks.com/topic/196367-a-folder-with-a-space/ Share on other sites More sharing options...
premiso Posted March 24, 2010 Share Posted March 24, 2010 If you are using a Linux OS for your server you will need to encase the directory in single quotes if it has a space in it. On windows, I believe you would have to encase the whole path in single quotes. But I do not see in that code where you are trying to delete / chown / chmod the directory? On another note, why not just replace the spaces with _ or -, as this will be much easier to manage and not require extra / special code to manipulate. Quote Link to comment https://forums.phpfreaks.com/topic/196367-a-folder-with-a-space/#findComment-1031063 Share on other sites More sharing options...
arbitter Posted March 24, 2010 Author Share Posted March 24, 2010 Well I want a space between the month and the year. The folder on the server, in DirectAdmin, is the same name as the month and year. I don't want to put a underscore or - because that isn't that pretty, seems to me. It isn't prety like this eather, but it's better than nothing I guess. How do you mean that you can't see where I'm trying to delete the directory? What should I show? It was in DirectAdmin that I had problems with filenames with a space in it. I can't put any ' 's in the name of the folders... Quote Link to comment https://forums.phpfreaks.com/topic/196367-a-folder-with-a-space/#findComment-1031066 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.