two annoying errors

Discussion in 'PHP' started by asgsoft, Jul 6, 2007.

  1. #1
    Hi

    Recently I've had these two errors:

    On my forum:

    On my directory:


    Any ideas what could possibly be causing them and how I can fix them?
     
    asgsoft, Jul 6, 2007 IP
  2. norfstar

    norfstar Peon

    Messages:
    1,154
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not sure about the first one, but the "Cannot redeclare http_redirect()" is fairly simple. PHP has things called functions, which begin with code like:

    function nameoffunction($valueA,$valueB){
    Code (markup):
    and end with a closing:

    }
    Code (markup):
    Find in your scripts where it says

    function http_redirect(){
       /* stuff here */
    }
    Code (markup):
    It will be there more than once. Either delete the second (third, fourth, fifth etc if they exists) declaration of this function, or put:

    if (!function_exists('http_redirect')){
       function http_redirect(){
          /* stuff here */
       }
    }
    
    Code (markup):
    which will stop it being redeclared if it already exists.
     
    norfstar, Jul 6, 2007 IP
  3. asgsoft

    asgsoft Well-Known Member

    Messages:
    1,737
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    160
    #3
    But why would it just start appearing even if I haven't provoked it?

    After deleting it's fixed so thank you.
     
    asgsoft, Jul 6, 2007 IP
  4. norfstar

    norfstar Peon

    Messages:
    1,154
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It appears if it is declared twice, that's the provocation. I can't tell any more without access to the code itself.
     
    norfstar, Jul 6, 2007 IP
  5. asgsoft

    asgsoft Well-Known Member

    Messages:
    1,737
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    160
    #5
    Well deleting the whole chunk seems to have fixed it, lets just hope no more errors come :S
     
    asgsoft, Jul 6, 2007 IP
  6. asgsoft

    asgsoft Well-Known Member

    Messages:
    1,737
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    160
    #6
    regarding the first error, i have some more details now

    in my error_logs I get this error:

    Anyone got any ideas?
     
    asgsoft, Jul 7, 2007 IP