Jump to content

Blank page when instantiating a class


Krummelz

Recommended Posts

OK I'm really frustrated here. I have a class that is meant to handle uploading of files to the server.

 

When I comment out the line that instantiates the class, everything works fine. When I try to instantiate the class, I get a blank page.

 

Here are the most important lines of code:

 

include ($_SERVER['DOCUMENT_ROOT']."/classes/upload/upload_class.php");

$my_upload = new file_upload;

 

I have no idea what to do ???, and have been searching the web for a while now, without an answer.

 

 

Link to comment
https://forums.phpfreaks.com/topic/133050-blank-page-when-instantiating-a-class/
Share on other sites

The class is a free download from Softpedia.com -> http://webscripts.softpedia.com/scriptDownload/Easy-PHP-Upload-Download-1861.html

 

I think I may have found the problem, and this killed two birds with one stone - I could not get errors to show even when I did add error_reporting(E_ALL);

 

Adding error_reporting(E_ALL); and ini_set("display_errors","1"); showed me that the $_SERVER['DOCUMENT_ROOT'] in the include line made it point to the wrong directory of "C:/wamp/www/classes/upload/upload_class.php" instead of "C:/wamp/www/WEBSITENAME/classes/upload/upload_class.php"

 

Thanks guys.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.