Page 1 of 1

cannot redeclare function error

Posted: Thu Apr 19, 2007 3:30 pm
by royrogersrevenge
Hey everyone,

I am getting the following error message every time i run a certain page.
Fatal error: Cannot redeclare get_random_picture() (previously declared in /home/media233/public_html/game/functions.php:2) in /home/media233/public_html/game/functions.php on line 13
I have only defined the function in functions.php and i'm not entirely sure what functions.php:2 means. Could someone help me figure out what the problem might be?

Thanks,
Roy

Posted: Thu Apr 19, 2007 3:35 pm
by John Cartwright
Is appears you are including the functions.php file twice, therefore defining the function twice.

Either eliminate the second include() for functions.php, or change your include() to include_once() or require_once()

Posted: Thu Apr 19, 2007 3:35 pm
by arturm
It looks like you included functions.php twice on your page

use include_once() or just review your code and remove duplicate includes.

Posted: Thu Apr 19, 2007 4:00 pm
by royrogersrevenge
Gah, it appears you were correct. I included functions.php more than once by accident.

Thanks for the help!
Roy