illustrationism Posted June 10, 2009 Share Posted June 10, 2009 All right, so this is very strange... I have an AJAX file manager set up, and when I pass information to remove a directory, rmdir() returns true, but DOES NOT DELETE THE DIRECTORY. Using the same script, and simply posting with an HTML form returns true and DOES delete the directory. I'm using Javascript POSTing the data to a PHP script, which returns either true or false - it only returns true if rmdir() returns true; literally. Like I said earlier, I copy/pasted the code to a different file and used an HTML form to POST the data instead of having Javascript POST it, and it works. So here's my question: Why would rmdir() return true if it didn't actually delete the directory? Thoughts? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/161708-solved-spooky-rmdir-problem/ Share on other sites More sharing options...
Maq Posted June 10, 2009 Share Posted June 10, 2009 Can you post some of the code surrounding your rmdir call? Quote Link to comment https://forums.phpfreaks.com/topic/161708-solved-spooky-rmdir-problem/#findComment-853241 Share on other sites More sharing options...
illustrationism Posted June 11, 2009 Author Share Posted June 11, 2009 Actually, it looks like it's working now... What we were doing is (for some reason) passing a hex-encoded version of the directory path, and translating it back into standard text. Don't ask me why... But I saw that yesterday evening and altered it to use the real directory path. All is well in the universe this morning, it seems. Javascript guy says it's working, and it seems to be working for me too. Not sure what the exact problem was, but it was definitely strange. Things work now. Thanks, David Quote Link to comment https://forums.phpfreaks.com/topic/161708-solved-spooky-rmdir-problem/#findComment-853749 Share on other sites More sharing options...
Maq Posted June 11, 2009 Share Posted June 11, 2009 Hmm not really sure exactly what you're talking about. What I don't understand why it's returning true when nothing is actually being removed... Quote Link to comment https://forums.phpfreaks.com/topic/161708-solved-spooky-rmdir-problem/#findComment-853761 Share on other sites More sharing options...
illustrationism Posted June 11, 2009 Author Share Posted June 11, 2009 Neither am I... We were sending through POST something like: 2f746573742f68656c6c6f and it was being translated from hex to text as: /test/hello Then we'd take that, and append it to the site directory path, so we'd end up with something like: /home/usr/project/public_html/files/test/hello Which is a valid path, and would make rmdir() return true. Yet it wouldn't get deleted. When I switched it to just pass the /test/hello as a POST variable instead of the hex-encoded variable, it worked. Again, I'm not sure why it was using hex, but there's no reason for it. So I took it out. Still... Strange, right? Quote Link to comment https://forums.phpfreaks.com/topic/161708-solved-spooky-rmdir-problem/#findComment-853767 Share on other sites More sharing options...
Maq Posted June 11, 2009 Share Posted June 11, 2009 Again, I'm not sure why it was using hex, but there's no reason for it. So I took it out. Me either, although I guess it kind of makes sense. Quote Link to comment https://forums.phpfreaks.com/topic/161708-solved-spooky-rmdir-problem/#findComment-853769 Share on other sites More sharing options...
illustrationism Posted June 11, 2009 Author Share Posted June 11, 2009 Well I know why hex was used (for the HTML IDs), but why it was being passed using Javascript, I don't know. Quote Link to comment https://forums.phpfreaks.com/topic/161708-solved-spooky-rmdir-problem/#findComment-853770 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.