Gremlyn1
01-13-2010, 08:30 PM
I am having a VERY strange problem! I have a new site I am working on and have a very basic index.php:
<?php
include_once 'libs/config.inc.php';
function __autoload($className){
require_once 'libs/classes/' . $className . '.class.php';
}
$conn = new mysql;
if ($conn->conn() !== TRUE) {
die("Database connection could not be made");
}
$output = new tables;
$output->table_id = "govt";
$output->table_class = "display";
$table = $output->output_all('government');
include_once 'libs/layout/header.inc.php';
echo $table;
include_once 'libs/layout/footer.inc.php';
?>
This page will not properly include the classes or the header/footer files. If I remove the attempt at including anything but the config.inc.php, I can properly display my constants from that file, so I know that is working. I can also hard code the classes into the index.php file and they work as expect OR if I change the file names to remove the .inc and .class (with exception of the appropriately functioning config.inc.php) then the page also works. I can't for the life of my figure this one out. I have tried just including the header/foot files without the class code and that does work and vice versa.
phpMyAdmin is installed on the server, so I know that this naming convention is working there. What on earth could possibly be going on?
EDIT: Also forgot to mention that is I use 'include_once' instead of 'require_once' for the class autoloader, I get an error message saying the class can't be found on the line tat I try to instantiate it, whereas with require_once I get a blank screen.
<?php
include_once 'libs/config.inc.php';
function __autoload($className){
require_once 'libs/classes/' . $className . '.class.php';
}
$conn = new mysql;
if ($conn->conn() !== TRUE) {
die("Database connection could not be made");
}
$output = new tables;
$output->table_id = "govt";
$output->table_class = "display";
$table = $output->output_all('government');
include_once 'libs/layout/header.inc.php';
echo $table;
include_once 'libs/layout/footer.inc.php';
?>
This page will not properly include the classes or the header/footer files. If I remove the attempt at including anything but the config.inc.php, I can properly display my constants from that file, so I know that is working. I can also hard code the classes into the index.php file and they work as expect OR if I change the file names to remove the .inc and .class (with exception of the appropriately functioning config.inc.php) then the page also works. I can't for the life of my figure this one out. I have tried just including the header/foot files without the class code and that does work and vice versa.
phpMyAdmin is installed on the server, so I know that this naming convention is working there. What on earth could possibly be going on?
EDIT: Also forgot to mention that is I use 'include_once' instead of 'require_once' for the class autoloader, I get an error message saying the class can't be found on the line tat I try to instantiate it, whereas with require_once I get a blank screen.