Jump to content

[SOLVED] directory path question...


acctman

Recommended Posts

No.  '/' will go to the root directory.  There are few cases where you need to hard-code a path.

 

If you're in the directory "public_html" you can use:

 

mkdir("rimgs");

 

and it will create the foldef "rimgs" in the public_html dir.

 

so it would always be good to use the "/" to start at the root just to make sure where ever the script is processed it the folder is created in the right area.

 

thanks for the info

No.  For portability reasons you should use relative paths.  Your development environment and production environment should maintain the same directory structure, even if it's from windows to linux.

 

i.e.

 

Your folder structure looks like this:

 

/dir1/dir2/includes/

/dir1/dir2/main/

 

You're currently in the 'main' directory and you want to create a folder called 'rimgs' in the includes folder.  You would code it like:

 

mkdir("../includes/rimgs");

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.