# \[php\] re-declare function error

**URL:** <https://forum.kirupa.com/t/php-re-declare-function-error/213260>\
**Category:** programming\
**Created:** [January 18, 2007, 4:57am UTC](https://forum.kirupa.com/t/php-re-declare-function-error/213260 "2007-01-18T04:57:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeoDreamer](https://avatars.discourse-cdn.com/v4/letter/n/ccd318/32.png) [@NeoDreamer](https://forum.kirupa.com/u/NeoDreamer)\
**Post date:** [January 18, 2007, 4:57am UTC](https://forum.kirupa.com/t/php-re-declare-function-error/213260/1 "2007-01-18T04:57:32Z")

</div>

This is how my site works: Index.php is the shell of the site. It has all the graphics and layout tables. Each link is structured like index.php?sec=contact. I use $\_GET to find which section the user wants to go to. And then I load the page content by running secCode(). secCode() is the function in contact.php, for example, that contains all the contact content.

```php

$section = $_GET['sec'];
$section .= ".php";
include("$section");
secCode();

```

I’ve done include(“constants.php”) in index.php, but whenever I load a whateverSection.php, the constants are no longer in scope. So I re-include constants.php within the section code. This is where the re-declare error lies. How do I fix it?
