Solved

Fatal error: Cannot redeclare class email

Posted on 2006-06-14
7
650 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
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to populate a dynamically created text input from ajax return 18 48
PHP AJAX Wordpress 9 21
Really simple no curl. Send a post 3 times 4 25
two ways encryption with php 3 28
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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 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 …

809 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