RSS

|| php || tip || physical path tracking

19 Oct

Including file from nested directory is simple and straight forward while being at root directory, but for including files in php in nested directories beginners claim that they have did everything perfectly right but the file didn’t get called.
Following are the few cases for nested file calls,
1) ./ within the same folder e.g. currently in folder1/file1.php and want to access folder1/file2.php
2) ../ with the depth of one level e.g. currently in folder1/folder1.1/file3.php and want to access folder1/file2.php
3) ../../ with the depth of two levels e.g. currently in folder2/folder2.4/folder2.4.5/file4.php and want to access folder2/file5.php
4) ../../../ with the depth of three levels e.g. currently in folder5/folder5.3/folder5.3.1/folder5.3.1.7/file6.php and want to access folder5/file7.php

Thats it 🙂

Advertisements
 
Leave a comment

Posted by on October 19, 2011 in php

 

Tags: , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: