Forum Moderators: coopster
I have learnt that the Fatal Error: message seems to mean that there is a duplicate somewhere which needs to be sorted but I don't know where to look to sort the problem (am not too clued up on this you can tell).
I think the clue is in the error message but if I go to that file I'm not sure what to look for or what to alter or what to alter it to!
Any help would be very much appreciated.
Fatal error: Cannot redeclare class currencies in /includes/classes/currencies.php on line 16
Could you please explain what >>not including a file which is including another file included in your page means as I'm new to this and am not sure what this sentence means.
Many thanks
globals.php
<?php
include "currencies.php";
$sitename='example.com';
$sitepath='/home/user/example';
?>
currencies.php
<?php
class currencies {
public $conversion;
public $last_result;
public function convert($amountt) {
}
}
?>
view.php
<?php
include 'globals.php';
include 'currencies.php';
$currency = new currencies;
?>
view.php includes globals, which includes currencies. Then view.php includes currencies itself, which will generate the error you describe. To fix it, you'll need to start at the script you're trying to load into your browser and backtrack each of the files it includes to see where currencies is getting included. You may be able to fix it by changing each of the include directives to include_once [us.php.net].