Accessing a protected folder from a parent folder with PHP?

  • dilletante
  • Newbie
  • Newbie
  • dilletante
  • Posts: 5

Post 3+ Months Ago

Hello all. I'm a newbie with some experience designing web sites. I have a question I think/hope is fairly basic about security and PHP scripts.

Situation: I have a website with a folder, let's say X1. There is a subfolder of X1 called X1a.

If I put an .htaccess file into X1a and set the appropriate permissions, I know that no one can access anything in X1a without a password (in theory, anyway! <g>.

What I would like to do is put a PHP script in the parent, X1, that opens a page contained in X1a. I know how to do that using PHP and the Javascript function. My question is, are there any techniques that are particularly good (options/parameters in .htaccess, permissions) for this task? Any especially good ways of doing it?

Thx all.
  • _Leo_
  • Proficient
  • Proficient
  • User avatar
  • Posts: 279
  • Loc: Buenos Aires, Argentina

Post 3+ Months Ago

The problem is .htaccess won't let any client to have access to the files in the protected folder, unless you include the protected file via include() or require() PHP functions. Those functions work at operating system level, so are restricted to OS permissions and not to .htaccess.

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 24 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.