Jump to content

Cannot redeclare redirect_to()


surreal5335

Recommended Posts

I am getting an error stating:

 

Fatal error: Cannot redeclare redirect_to() (previously declared in /home1/royalvil/public_html/post_ads/controller.php:9) in /home1/royalvil/public_html/post_ads/controller.php on line 14

 

The code is as follows for the function:

 

function redirect_to($address) {

header('location:'.WEBSITE.APP_ROOT.$address);
exit;

}

 

The only other place this function is used in another file is here:

 

redirect_to('posts');

 

Any ideas as to what this is refering to?

 

Thanks a lot for the help

Link to comment
https://forums.phpfreaks.com/topic/188165-cannot-redeclare-redirect_to/
Share on other sites

The code is as follows for the function:

 

Yes, but that does not show the relevant code leading up to that point that is causing that function definition to be evaluated more than once.

 

The function definition is either within a loop or is in a file that is being included more than once. Without showing the context where the function definition exists, it is not possible to directly help with the problem.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.