Solved

Fatal error: Cannot redeclare class email

Posted on 2006-06-14
7
648 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
This article discusses how to create an extensible mechanism for linked drop downs.
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 create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 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

23 Experts available now in Live!

Get 1:1 Help Now