[thelist] PHP "cannot redeclare" function

Mattias Thorslund mattias at thorslund.us
Thu Apr 9 09:04:05 CDT 2009


Barney Carroll wrote:
> *Fatal error*: Cannot redeclare httpref() (previously declared in
> E:\domains\a\antonio\user\htdocs\data.php:11) in *
> E:\domains\a\antonio\user\htdocs\data.php* on line *13*
>
> Lines 11 to 13 of data.php are as follows:
>
>   function httpref($url){
>     return stristr($url, "\htdocs");
>   }
>
> There is nothing else anywhere by the name of httpref. I can't see how this
> ultrabasic function can conflict with itself. Is this the server's
> roundabout way of telling me I can't write functions?
>   

Maybe you forgot to use include_once or require_once instead of include 
or require when including the file in your page?

Cheers,

Mattias



More information about the thelist mailing list