Best Method of Accessing Files From Home Directory

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

jplus2
New php-forum User
New php-forum User
Posts: 87
Joined: Wed May 16, 2012 4:17 pm

Best Method of Accessing Files From Home Directory

Postby jplus2 » Tue Oct 16, 2012 7:02 pm

I am storing all my files which contains sensitive information on my sites home directory.

the way I access it is via code below

[php]$path = dirname($_SERVER['DOCUMENT_ROOT']).DIRECTORY_SEPARATOR.'folderiwanttoaccess'.DIRECTORY_SEPARATOR.'fileiwantoaccess.php';[/php]

I am using this approach so it is a bit portable, not path dependent

I just want to ask if there is a better way to do it, like a recommended way or best practice

Thank you in advance

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 3 guests