Solved

Fatal error: Cannot redeclare class email

Posted on 2006-06-14
7
654 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

707 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