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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.