Forum Moderators: coopster
this newbie has concluded that...
a file called...say...config.php place in the root folder with variables/functins/classes defined would control every call of those v/f/c/ in subfolders.
Is there a standard control page floating around that would save me re-inventing the wheel?
You might want to take a look at mod_rewrite / .htaccess (there is loads of info in the site search and also members!).....you could include the config.php in every file under a folder using an .htaccess file.
I would write code here for you but it may be incorrect so I'll leave it to those in the know ;)
if (isset ($_GET['action'])) {
$_POST['action'] = $_GET['action'];
}switch ($_POST['action']) {
case "add":
require ("add.inc");
add ();
break;
case "delete":
require ("delete.inc");
delete ();
break;
default:
require ("menu.inc");
menu ();
break;
}
Allen
Now is it necessary to have the reference on each page or does it inherit the variable without any reference?....
OOPS! I just remember seeing and include statement on each page in my admin folder here is the common code.
<code>
<?
include("config.php");
include("genlib.php");
$textpart = "browsedocs";
include("getlang.php");
include("$mylanguage/text.php");
db_connect($database_host,$database_name,$database_username,$database_password) or exit;
</code>
I am literally learning as I compose this message...a little like talking myself in the right path...
I am assuming that PHP core functions are inherited without any reference other than in php.ini in the servers PHP installation. (I am on a Shared Unix Linux Server)
Would it be advantageous for me to check a standard php.ini file to see just what is in there?...never thought of it until now..
My goal is to set up a database driven site that I can cookie cutter in a situation where I host in a community oriented environment.
Along the way I hope to become proficient in PHP/MySql