Fatal error: Cannot redeclare class

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
granite
Forum Commoner
Posts: 44
Joined: Mon Feb 09, 2009 10:52 am

Fatal error: Cannot redeclare class

Post by granite »

Hey, brows!

I'm with problems with a class. Its name is "class.conf.php".

I get this error: "Fatal error: Cannot redeclare class conf"

Here goes the code:

Code: Select all

<?
 
class conf{
 
   var $DB_USER="sis_pes_adm";
   var $DB_HOST="localhost";
   var $DB_PASS='b3|V||>^|V735';
   var $DB_BASE="sis_autores";
   var $SEMENTE_SEGURANCA='esl)(-_';
   var $SEMENTE_SEGURANCA2='6X@{/el,Dw!gP2fzh';
   var $B_ADMIN='K9Nxt.K####@@@!!!eFzYae^';
   var $C_ADMIN='#2edce93/*/*/09e39586b01#';
   var $DB_TABELA;
   var $DB_CAMPOS;
   var $DB_resultado;
   var $DB_RESULTADOS;
   var $lista;
   var $conn;
   var $EST_PARAMETROS;
   var $LOG_ARQUIVO="../log/log_erros.txt";
   var $uploaddir="../imagens/produtos/";
   var $img_tipos=array("foto");
   var $perm_tipos=array("jpg","jpeg","gif");
 
   function conf(){
 
   }
 
}
 
?>
Can someone help me, please?

Thanks. :)
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Fatal error: Cannot redeclare class

Post by requinix »

Somewhere you're including or requiring this file. Use include_once or require_once instead.
granite
Forum Commoner
Posts: 44
Joined: Mon Feb 09, 2009 10:52 am

Re: Fatal error: Cannot redeclare class

Post by granite »

Hm, ok, I solved this. I had two classes with the same name. :oops:

Thank you, tasairis. :)
Post Reply