Solved

Fatal error: Cannot redeclare class email

Posted on 2006-06-14
7
649 Views
Last Modified: 2013-12-13
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?
0
Comment
Question by:scm0sml
  • 4
  • 3
7 Comments
 
LVL 33

Accepted Solution

by:
snoyes_jw earned 250 total points
ID: 16904850
Most likely, the class definition is in a file that you include or require, and some other included file also includes or requires that file.  Use include_once or require_once instead.
0
 

Author Comment

by:scm0sml
ID: 16904903
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?
0
 

Author Comment

by:scm0sml
ID: 16904924
yeah that works...........wouldn't even have thought of that!!

cheers!
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 33

Expert Comment

by:snoyes_jw
ID: 16904935
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.
0
 

Author Comment

by:scm0sml
ID: 16905061
include_once"../includes/classes/Owner.php";

like that?
0
 
LVL 33

Expert Comment

by:snoyes_jw
ID: 16905075
yep
0
 

Author Comment

by:scm0sml
ID: 16905091
thanks a lot.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now