What is in your index.php?
Posted: Sun Sep 04, 2011 12:17 am
An open question this, and one that may or may not bear fruit. But here we go anyway.
index.php is a special case I feel because it is often the default script that is called for a web site. Moreover, I keep mine in the freely available root directory, but the rest of my php is out of the root for security purposes - in a directory called "lib".
The app I am working on at the present time requires that a user logs on first. So, the code I have in my index.php is very simple:
This at least is what I have presently. So I have a few questions:
1. Is treating index.php as a special case, a reasonable approach would you say?
2. Is the separation of the rest of the non-client php files a real security improvement?
3. When you declare the css path, do you use absolute path names? If so, how might it be done so it will work on local (testing) AND the main server (production) with no code change?
4. includes_path - I assume this is the path to the includes directory. However, I am not sure/happy/comfortable with this just yet. Can more than one path be included in this? (I have Googled around but still unhappy) If so, how so? Does this approach works across platforms? If not, is there a way to make it?
Many thanks for any help.
S
index.php is a special case I feel because it is often the default script that is called for a web site. Moreover, I keep mine in the freely available root directory, but the rest of my php is out of the root for security purposes - in a directory called "lib".
The app I am working on at the present time requires that a user logs on first. So, the code I have in my index.php is very simple:
Code: Select all
<?php
/* Require Log In */
require("lib/ezLogin.php");
?>
1. Is treating index.php as a special case, a reasonable approach would you say?
2. Is the separation of the rest of the non-client php files a real security improvement?
3. When you declare the css path, do you use absolute path names? If so, how might it be done so it will work on local (testing) AND the main server (production) with no code change?
4. includes_path - I assume this is the path to the includes directory. However, I am not sure/happy/comfortable with this just yet. Can more than one path be included in this? (I have Googled around but still unhappy) If so, how so? Does this approach works across platforms? If not, is there a way to make it?
Many thanks for any help.
S