Link to home
Start Free TrialLog in
Avatar of scm0sml
scm0sml

asked on

Fatal error: Cannot redeclare class email

Fatal error: Cannot redeclare class email

A bit vague I know but can any1 give me any hints as to why I'm getting this error......

I only ever declare an email class once...........

any ideas?
ASKER CERTIFIED SOLUTION
Avatar of snoyes_jw
snoyes_jw
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of scm0sml
scm0sml

ASKER

yeah your right......

In this file I include:
  include "../includes/classes/Owner.php";
&
  include "../includes/classes/Email.php";

But the owner class also includes the email class.

So are you saying that I do not need to include the email class in this file because it will be usable having included it in the owner class?
Avatar of scm0sml

ASKER

yeah that works...........wouldn't even have thought of that!!

cheers!
Right, once it's included, it's available throughout.  But you can use the special include_once instead of include, so you don't have to worry about whether or not your included it already.
Avatar of scm0sml

ASKER

include_once"../includes/classes/Owner.php";

like that?
Avatar of scm0sml

ASKER

thanks a lot.