I was making changes to my portfolio site on my computer (running Abyss w/ PHP v5.2.0 to test locally). I triple checked everything and fixed all the errors. So, I start uploading stuff to the web server my portfolio is hosted on (PHP v5.2.3). I open 'er up in my browser and I get a blank page (actually errors first, see below). Doh!
One of the changes I made, there is now a class method that includes an external file like so: include('xx/xx/filename.inc').
Originally the method looked something like this:
PHP Code:
<?php
function getPage($doc) {
@(include("xx/xx/".$doc.".inc")) OR die('file not found');
}
?>
Pretty basic/simple. The die() is there as a quick and easy solution for a custom error message. It displays regardless of the @ at the beginning of the line. When I first uploaded to the web server I got the error message from the die() function. I checked everything out and all files and directories were right. Paths and permissions were fine as well. After that I changed the include line to this:
PHP Code:
<?php
function getPage($doc) {
include("xx/xx/".$doc.".inc");
}
?>
...and that just got me a blank page. Now I'm stuck. Is there a difference in settings within each php.ini that might cause this? Difference in PHP versions? Did I totally miss something?
edit: To explain how the class works a little better...
The index.php file in the root folder grabs the requested page and passes it through a switch construct. It looks like this:
PHP Code:
switch ($_SERVER['QUERY_STRING'])
case 'blah':
$pgBuild = new Doc_Render();
$pgBuild->czHeader = 'headblah';
$pgBuild->czContent = 'blah';
$pgBuild->pgRender();
break;
default:
$pgBuild = new Doc_Render();
$pgBuild->czHeader = 'headerhome';
$pgBuild->czContent = 'home';
$pgBuild->pgRender();
The Doc_Render class simply takes the 2 variables given, runs them through separate functions to find header and content files, and then displays the requested content.
Obviously including files isn't a problem since I was originally seeing the custom error messages coded within a class method. This is why I asked the questions above with regards to those include() lines inside of a class method.
thanks