Jump to content

[SOLVED] security tutorial - Outside file access


Lambneck

Recommended Posts

I don't get it...

 

http://www.phpfreaks.com/tutorial/php-security/page5

 

what is public_index.php?

 <?php  
  require '../public_index.php';  
    ?>  

 

if public_html is the root then how can public_index.php be outside it?

/application

  /controllers

  /models

  /views

/library

/public_html <-- document root

  /index.php

  /media

    /images

    /javascript

    /css

/config

/cache

/tmp

/public_index.php

/logs

 

 

i confused!  ???

 

 

Yes, it is an example page.  And it is outside of /public_html.  /public_html is not the root, it's a directory in the root.  public_index.php is also in the root, but not in the /public_html directory (or any subdirs of it), hence, it's outside the directory.

 

/public_html is the "root" as far as the outside world is concerned, but it is not the root directory of the server.

it doesn't matter what is in public_index.php.  You can have whatever you want in it.  People usually keep stuff like db connection info in it and then include or require it in some other x.php script that is in public_html directory.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.