Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal Error


pgmakr05

Recommended Posts

Posted

For some reason I keep getting this error when trying to access index.php of the catalog for the main page.

 

Fatal error: main(): Failed opening required 'include/class.webfamilytv.php' (include_path='.:/php/includes:/usr/share/pear/:/var/www/php/php/') in /var/www/docs/webfamilytv.com/catalog/index.php on line 4

 

I have no idea why its doing this. Since I can't post the files themselves I will copy the 2 I think the problem is coming from.

 

/catalog/index.php:

<?php

//ini_set('error_reporting', E_ALL);

$item = $_GET["item"];

require_once("include/class.webfamilytv.php");

$utils = new utils;

 

switch ($item) {

case "main" :

$utils->buildMainPage();

break;

case "dr" :

$utils->buildDrSite();

break;

case "gwuc" :

$utils->buildGWUCSite();

break;

case "listen" :

$utils->buildListeningPage();

break;

case "products" :

header("Location: /catalog/");

break;

case "aboutus" :

$utils->buildAboutUsPage();

break;

case "ceo" :

$action = $_GET["action"];

switch ($action) {

case "news" :

$utils->buildCEONewsPage();

break;

case "money" :

$utils->buildCEOMoneyPage();

break;

case "project" :

$utils->buildCEOProjectPage();

break;

case "book" :

$utils->buildCEOBookPage();

break;

case "leadership" :

$utils->buildCEOLeadershipPage();

break;

case "business" :

$utils->buildCEOBusinessPage();

break;

default :

$utils->buildCEOPage();

break;

}

}

?>

 

 

 

-------------------------------------------------------------------------------------------

/include/class.webfamilytv.php:

<?php

class utils {

var $TEMPLATE_DIR;

var $MAIN_PAGE;

var $DRSITE_PAGE;

var $GWUC_PAGE;

var $CE0_PAGE;

var $CEO_NEWS_PAGE;

var $CE0_MONEY_PAGE;

var $CE0_PROJECT_PAGE;

var $LISTENING_PAGE;

var $CEO_BOOK_PAGE;

var $PRODUCTS_PAGE;

var $CEO_LEADERSHIP_PAGE;

var $CEO_BUSINESS_PAGE;

var $ABOUTUS_PAGE;

 

function utils() {

$this->TEMPLATE_DIR = "templates/";

$this->MAIN_PAGE = "main.htm";

$this->DRSITE_PAGE = "drsite.htm";

$this->GWUC_PAGE = "gwuc.htm";

$this->CEO_PAGE = "ceo.htm";

$this->CEO_NEWS_PAGE = "ceonews.htm";

$this->CEO_MONEY_PAGE = "ceomoney.htm";

$this->CEO_PROJECT_PAGE = "ceoprojectofthemonth.htm";

$this->LISTENING_PAGE = "listening.htm";

$this->CEO_BOOK_PAGE = "ceobookofthemonth.htm";

$this->PRODUCTS_PAGE = "products.htm";

$this->CEO_LEADERSHIP_PAGE = "ceoleadership.htm";

$this->CEO_BUSINESS_PAGE = "ceobusiness.htm";

$this->ABOUTUS_PAGE = "aboutus.htm";

include_once("template.inc");

}

 

function buildMainPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->MAIN_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildDrSite() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->DRSITE_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildGWUCSite() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->GWUC_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildCEOPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->CEO_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildCEONewsPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->CEO_NEWS_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildCEOMoneyPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->CEO_MONEY_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildCEOProjectPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->CEO_PROJECT_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildListeningPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->LISTENING_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildCEOBookPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->CEO_BOOK_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", "main");

$template->pparse("output", "fh");

}

 

function buildProductsPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->PRODUCTS_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildCEOLeadershipPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->CEO_LEADERSHIP_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildCEOBusinessPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->CEO_BUSINESS_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

 

function buildAboutUsPage() {

$template = new Template($this->TEMPLATE_DIR);

$template->set_file("fh", $this->ABOUTUS_PAGE);

$template->set_block("fh", "mainBlock", "main");

$template->parse("main", "mainBlock", false);

$template->pparse("output", "fh");

}

}

?>

Posted

Ok on line number 4

 

1 //ini_set('error_reporting', E_ALL);

2 $item = $_GET["item"];

3 require_once("include/class.webfamilytv.php");

4 $utils = new utils;

 

 

new utils nees to be a string or a variabe.

 

If you want it to be a string

you will need to add quotes "" so it will look like this $utils = "new utils";

 

you probably want it to be a variable so yu have to make it to be

 

$utils = $new_utils;

 

No spaces in the variable name and a Dollar sing ($) before the name

at the end of the day the code will be good

Posted

you should look thru all the code and count the lines, usually this:

require_once("include/class.webfamilytv.php");

goes like this:

require_once('include/class.webfamilytv.php');

Posted

Hm, just tried that and it didn't work. Exact same error on line 4. I hope I don't have to go get another script instead. I have a client waiting on this one.

Archived

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

×
×
  • Create New...