mohammedk1000
mohammedk1000

Reputation: 11

in php - how to access the Folders which are out side the Web root Directory

How can we access the Folders out side the Web root Directory?

We are using WAMPSERVER 2.0 (Apache 2.2.11,php 5.3.0 & My Sql 5.1.36).

Upvotes: 1

Views: 5078

Answers (2)

Felix Kling
Felix Kling

Reputation: 816302

usr
| - www
     |- docs
        |- A
     |- webroot
        |- index.php

Just use "normal" file paths. E.g. to access A in the docs folder from index.php, you can use relative paths like ../docs/A or absolute paths like /usr/www/docs/A.

The "webroot" directory only marks the entry point for URLs. This has no effect on PHP files. They are just normal files in a filesystem and can therefore access other files in the system via ordinary file paths.

Upvotes: 3

sushil bharwani
sushil bharwani

Reputation: 30177

I think you just need to learn how to read directories in php http://www.webcheatsheet.com/PHP/working_with_directories.php

Upvotes: 2

Related Questions