Jump to content

Recommended Posts

I have a site which has one point of access for the end user: the "index.php" in the public_html dir.  Other pages are included by reference in this page: "index.php?p=news"

 

My question is should I place these included pages in a web accessible dir (below public_html), or should I place them above?  Also where should I put any class files I use?  If I put them above the public_html dir will it cause any problems?

 

Cheers,

 

Anthony

Also where should I put any class files I use?

 

I do this:

<?php
// LIB_PATH being defined to hold the path to the library folder
function __autoload($class)
{
$path = LIB_PATH . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
if(file_exists($path))
{
	require $path;
}
}
?>

 

In that way I don't have to include any class files. Database would be in /path/to/lib/Database.php, Database_MySQL would be in /path/to/lib/Database/MySQL.php etc.

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.