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

Trouble checking SESSION cookie
I am trying to use $_SESSION cookies to verify admin privileges .
I don't understand why this is

How to pass parameter to tag query?
Hi,
I want to get the value of a tag at a specific time (like 10/27/09 15:29:59), I need to giv

Email Processor
I have a few questions so this post will be a larger one! Sorry, but I'm a bit of a PHP newbie so be

Mass activity scheduling
Hi experts,

Im facing some problems to deal with mass activity jobs.
When I run some

Loop column after 2 results
Hello All.

Here is what I have:

Client ID Company name Clien

Performance impact of cookies
Hi, I was just wondering what impact there would be in terms of performance if you where to set then

Wierd if else problem
Hi guys,

this probably aint wierd for you, but it seems like php is playin up to me. may b i

Help with PHP Email Script
Hi guys,

I'm a newbie to php and need help with the script below:

At the moment when I

Email Script does not reach destination
Hey Guys look at this code snippet :
Code:
//read a line from the file

$myFile = "

opening a window with after form submission
I know this this forum has nothing to do with JS, but i'm trying to use it with my php script.
<

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