Anyone know how to solve this error?
Fatal error: Cannot redeclare class pear in c:\inetpub\wwwroot\core\pear\PEAR.php on line 68
this is what is on line 68
thanks!PHP Code:$t->parse('output', 'viewone');
Printable View
Anyone know how to solve this error?
Fatal error: Cannot redeclare class pear in c:\inetpub\wwwroot\core\pear\PEAR.php on line 68
this is what is on line 68
thanks!PHP Code:$t->parse('output', 'viewone');
show me lines 58-78
also make sure you only have the class "pear" declared once.
Here is the code I have...it is running off my localhost
PHP Code:<?php
/*--------------------------------------------------------------------
* INCLUDES
*--------------------------------------------------------------------*/
//core files
require_once('C:\\Inetpub\\wwwroot\\core\\pear\\PEAR.php');
require_once('C:\\Inetpub\\wwwroot\\core\\pear\\DB.php');
require_once('C:\\Inetpub\\wwwroot\\core\\classes\\Template.php');
require_once('C:\\Inetpub\\wwwroot\\core\\classes\\Image.php');
require_once('C:\\Inetpub\\wwwroot\\core\\modules\\common.php');
//site specific files
require_once(BASE_PATH . '\\common.php');
/*--------------------------------------------------------------------
* INITIALIZATIONS
*--------------------------------------------------------------------*/
$t = new Template(BASE_PATH . '\\templates\\', 'remove');
/*--------------------------------------------------------------------
* CONTROL STRUCTURE
*--------------------------------------------------------------------*/
switch ($_REQUEST['a'])
{
case null:
content_view();
break;
}
/*--------------------------------------------------------------------
* GARBAGE
*--------------------------------------------------------------------*/
$t = null;
/*--------------------------------------------------------------------
* MODULES
*--------------------------------------------------------------------*/
function content_view()
{
global $t;
$t->set_file ('viewone', 'view.html');
$t->set_block('viewone', 'no_data', 'no_data_block');
$t->set_block('viewone', 'view' , 'view_block');
$db = DB::connect(DB_DSN);
$display = $db_query("SELECT * FROM whatsnew");
if($display->numRows() == 0) {
$t->parse('no_data_block', 'no_data');
}
else {
$display_row = $display->fetchRow(DB_FETCHMODE_ASSOC);
$t->set_var('IMAGE', get_picture_html('viewone', $_REQUEST['nId']));
$t->set_var('TITLE', html($display_row['title']));
$t->set_var('DES' , html($display_row['des']));
$t->parse('view_block', 'view', true);
}
$t->parse('output', 'viewone');
$db->disconnect();
}
?>
require_once('C:\Inetpub\wwwroot\core\pear\PEAR.php');
Show me the code of that file considering it is the one that contains the error.
It is the standard PEAR.php file. It is too large to post the code so I have attached a .zip copy of it
you didn't declare it first. you may have in another script but if you want to use it again you have to declare it. mainly you have to set ip up again with a different object name.Quote:
if($display->numRows() == 0) {
$t->parse('no_data_block', 'no_data');
}
else {
$display_row = $display->fetchRow(DB_FETCHMODE_ASSOC);
$t->set_var('IMAGE', get_picture_html('viewone', $_REQUEST['nId']));
$t->set_var('TITLE', html($display_row['title']));
$t->set_var('DES' , html($display_row['des']));
$t->parse('view_block', 'view', true);
}
$t->parse('output', 'viewone');
sure is a lot of work to do something so simple as to connect to a database. :p