Results 1 to 6 of 6

Thread: PHP Error Message ***HELP***

  1. #1

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    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

  2. #2
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    show me lines 58-78
    also make sure you only have the class "pear" declared once.
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  3. #3

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    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

  4. #4
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    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.
    http://cpradio.net/
    Administrator @ WDForums and a Moderator @ WebXpertz City Forums

  5. #5

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    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 Attached Files
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  6. #6
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    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
  •  



Click Here to Expand Forum to Full Width