Sep 9th, 2002, 12:28 PM
#1
Thread Starter
Frenzied Member
PHP Error Message ***HELP***
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
PHP Code:
$t -> parse ( 'output' , 'viewone' );
thanks!
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
Sep 9th, 2002, 03:43 PM
#2
Fanatic Member
show me lines 58-78
also make sure you only have the class "pear" declared once.
Sep 9th, 2002, 03:47 PM
#3
Thread Starter
Frenzied Member
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 ();
}
?>
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
Sep 9th, 2002, 03:49 PM
#4
Fanatic Member
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.
Sep 9th, 2002, 03:54 PM
#5
Thread Starter
Frenzied Member
It is the standard PEAR.php file. It is too large to post the code so I have attached a .zip copy of it
Attached Files
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
Sep 9th, 2002, 04:41 PM
#6
Frenzied Member
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');
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.
sure is a lot of work to do something so simple as to connect to a database.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width