zfred09 Posted June 7, 2007 Share Posted June 7, 2007 Hi all, Ok first of all I dont know all the lingo for directory structure, so lets just say for now we are in the directory named firstdir. I then change directories to secdir without any problems. How would I change directories back to firstdir? I tried the code below but it doesnt seem to work. Thanks. chdir("../firstdir"); Link to comment https://forums.phpfreaks.com/topic/54521-backing-up-to-previous-directory-with-chdir/ Share on other sites More sharing options...
Yesideez Posted June 7, 2007 Share Posted June 7, 2007 chdir(".."); Your code was going back a directory then trying to get into a second directory called "firstdir" Link to comment https://forums.phpfreaks.com/topic/54521-backing-up-to-previous-directory-with-chdir/#findComment-269665 Share on other sites More sharing options...
zfred09 Posted June 7, 2007 Author Share Posted June 7, 2007 Thanks, Worked Perfectly, Any Ideas on where a tutorial would be located on this, I have tried searching google, but didnt know the name of what this kind of stuff is called so didnt really get any relevant results. Link to comment https://forums.phpfreaks.com/topic/54521-backing-up-to-previous-directory-with-chdir/#findComment-269680 Share on other sites More sharing options...
trq Posted June 7, 2007 Share Posted June 7, 2007 Theres really not much too it. Two dots .. goes back up one directory in the tree. ../../ would go back two directories. ../../foo would go back up two directories and then down into a directory called foo. Link to comment https://forums.phpfreaks.com/topic/54521-backing-up-to-previous-directory-with-chdir/#findComment-269683 Share on other sites More sharing options...
Yesideez Posted June 7, 2007 Share Posted June 7, 2007 Do you want tutorials on how to use chdir or how folders are structured? If its chdir then google "php chdir" for instructions on how to use it. You can use any function name after "php" in google to look up how to use it. Link to comment https://forums.phpfreaks.com/topic/54521-backing-up-to-previous-directory-with-chdir/#findComment-269685 Share on other sites More sharing options...
trq Posted June 7, 2007 Share Posted June 7, 2007 You can use any function name after "php" in google to look up how to use it. Or, simply type http://php.net/nameoffunction Link to comment https://forums.phpfreaks.com/topic/54521-backing-up-to-previous-directory-with-chdir/#findComment-269689 Share on other sites More sharing options...
Yesideez Posted June 7, 2007 Share Posted June 7, 2007 You can use any function name after "php" in google to look up how to use it. Or, simply type http://php.net/nameoffunction Sorry, I've got Google toolbar installed so its quicker for me to use that instead of typing URLs Link to comment https://forums.phpfreaks.com/topic/54521-backing-up-to-previous-directory-with-chdir/#findComment-269691 Share on other sites More sharing options...
zfred09 Posted June 7, 2007 Author Share Posted June 7, 2007 No, I was looking for directory structure stuff, but I've got that now. Thanks for your time. Link to comment https://forums.phpfreaks.com/topic/54521-backing-up-to-previous-directory-with-chdir/#findComment-269692 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.