Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.