Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Best Method of Accessing Files From Home Directory

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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
New php-forum User
New php-forum User
Posts: 87
Joined: Wed May 16, 2012 4:17 pm

Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot], Google Feedfetcher and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.