PHP Cannot redeclare class


Posted on 16th Feb 2014 07:03 pm by admin

I have 6 files, and two of them do not seem to want to play well. I keep getting a "Cannot redeclare class" error.

** edit **
I know its these 2 files, because when i comment out the include for login.php, the error goes away.
**end edit**

The full error:
Fatal error: Cannot redeclare class Base in coreBase.php on line 7

Base.php
Code: <?php
/**
* Base.php is the base class for all functions.
*
*/

class Base {

function __construct() {

include("Admin.php");
include("Feed.php");
include("Login.php");
include("Session.php");
include("SQLManager.php");
include("Twitter.php");

}

function __destruct() {
}

}
?>
Login.php
Code: <?php
/**
* Login.php is the class for all Application login functions.
*
*/

class Login extends Base {

function __construct() {
}

function Login() {
}

function Logout() {
}

function __destruct() {
}

}
?>
All of the files that are included in the Base __construct, extend Base.

Anyone have any ideas?

No comments posted yet

Your Answer:

Login to answer
302 Like 14 Dislike
Previous forums Next forums
Other forums

pagination - need help on passing of search query.
Hi, i have been trying for days but couldn't get this sorted out. Would like some professional help

Hyperlink is adding an extra gap to variable
Hi, here's my problem..

I have a php generated page with a hyperlink which opens in a new win

Problem assigning value to variable in "IF" function
Does this script makes sense? I am trying to take the value that is set to "authenticat" a

Inserting a variable in a link
I have this code that I want to insert for my own variable but I have no idea how. This is what I wa

Staff Induction System - No idea where to go from here!!!
Hi there, I'm pretty new to PHP and Mysql so could really do with being pointed in the right directi

DirectoryIterator and Hacked Website
Hi Everyone.

My problem:
Some one has been sneaking in to my website hidden Iframes. I've

Am I setting up my sites oldschool?
Ok,

When I create a site I open a basic template that I have created that consists of a css f

function not returning the correct value
I have a program that needs to return a value from a function. I have an output statement inside the

Kill a process
I have a question - how can I kill a process from a command line or by using Oracle SQL Developer? I

[Need Help] php timing issues
I don't know what is going wrong. I need some help with being able to set an image at 9:00am Colorad

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash