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.
Did you know?Explore Trending and Topic pages for more stories like this.
**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

PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg

list files from folder, only one for each date
I have many files in a folder and wish to only list one of each date

these are the file names

re calling a function without including file
Hi,
i am new to programming in php, i was just checking the wordpress code and found out in the w

Port scanner problem
Hai
recently i developed one app through which u can check the opened and closed ports under an

error checking breaking my code
Hi there, OK first of all, big apologies for what I assume is really fundamental errors in the struc

Sessions work for me and not others?
I'm having a bit of bad luck with sessions. In the past they have worked fine for me, but this time

query help
Hi experts.

i have a table rep2 like this
PROD_COD ACCT_NO DUE_DAYS BALANCE

Remove letter from numeric textbox
I have a textbox that will search the employee database by entering in the employee ID and it will r

New Search Engine problem
Hey everyone,

I have a ZIP Code Radius search engine already functional. it displays all of t

adding up might be solved tell us cheers.
i think i finally solved this anybody.

last time i was getting the wrong results.

Code

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