Cannot redeclare class

Gestart doorDesire3 reacties47 weergaven

4 berichten · pagina 1 van 1

Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik heb een vraag,

hoe haal ik deze fout eruit:

Quote:
Fatal error: Cannot redeclare class core in SITE on line 4

Dit is de class:
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]

[COLOR= #FF8000]//----------------------------------------[CORE CLASS][/COLOR]
[URL="http://www.php.net/class"]class[/URL] core [COLOR= #007700]{
    
    var[/COLOR] [COLOR= #0000BB]$fouten[/COLOR]        [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();
    var[/COLOR] [COLOR= #0000BB]$aantal_fouten[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [COLOR= #007700]function[/COLOR] add_fout[COLOR= #007700]([/COLOR][COLOR= #0000BB]$fout[/COLOR][COLOR= #007700])
    {[/COLOR]
        
        [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]fouten[COLOR= #007700][] =[/COLOR] [COLOR= #0000BB]$fout[/COLOR][COLOR= #007700];[/COLOR]
        
        [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]aantal_fouten[COLOR= #007700]++;
        
    }[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [COLOR= #007700]function[/COLOR] weergeef_fouten[COLOR= #007700]()
    {[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<ul>[/COLOR][COLOR= #007700];[/COLOR]
        
        [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]fouten [COLOR= #007700]as[/COLOR] [COLOR= #0000BB]$show_fout[/COLOR][COLOR= #007700])
        {[/COLOR]
            
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<li>[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$show_fout[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]</li>[/COLOR][COLOR= #007700];
            
        }[/COLOR]
        
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</ul>[/COLOR][COLOR= #007700];
        
    }[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [COLOR= #007700]function[/COLOR] aantal_fouten[COLOR= #007700]()
    {[/COLOR]
        
        [URL="http://www.php.net/return"]return[/URL] [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]aantal_fouten[COLOR= #007700];
        
    }[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [COLOR= #007700]function[/COLOR] verwijder_fouten[COLOR= #007700]()
    {[/COLOR]
        
        [COLOR= #0000BB]$this[/COLOR][COLOR= #007700]->[/COLOR]fouten [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]();
        
    }[/COLOR]
    
    [URL="http://www.php.net/public"]public[/URL] [COLOR= #007700]function[/COLOR] entities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700])
    {[/COLOR]
        
        [URL="http://www.php.net/return"]return[/URL] htmlentities[COLOR= #007700]([/COLOR][COLOR= #0000BB]$string[/COLOR][COLOR= #007700]);
        
    }

    
}[/COLOR]

[COLOR= #0000BB]$core[/COLOR] [COLOR= #007700]= new[/COLOR] core[COLOR= #007700];[/COLOR]

?>
En dit is de pagina waar de config word geincluded en in de config word classes weer geincluded:
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](([/COLOR][URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]hoi/index.php[/COLOR][COLOR= #007700]) !==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
    [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]includes/kolom_rechts.php[/COLOR][COLOR= #007700]);
}[/COLOR]
?>
<div id="center_2_middle">
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"hoi/index.php"[/COLOR][COLOR= #007700]);[/COLOR] ?>
</div></div>
Mvg,
Desire
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je hebt de class al ergens aangemaakt aan die error te zien.
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Je lost dat op door voortaan include_once te gebruiken, of door even na te gaan waar hij 2x geïnclude wordt.
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Include_once heb ik al gebruikt en toen was de error weg maar er kwamen tig errors voor in de plaats. Dus ik heb include_once weer weggehaald. Als Nielsjojo weer online komt dan kijkt hij even met teamviewer, als het hem niet lukt kom ik hier weer op terug.

toevoeging op 31 mei 2013, 12:24:52:
Opgelost.
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren