TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 03-08-2008, 09:19 AM   #1 (permalink)
The Acquainted
 
obolus's Avatar
 
Join Date: Oct 2007
Location: florida
Posts: 110
Thanks: 36
obolus is on a distinguished road
Default Blank Page =(

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
obolus is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 06:50 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design