Cannot redeclare file_get_contents_an()

Discussion in 'Co-op Advertising Network' started by I. Brian, Sep 13, 2005.

  1. #1
    I periodically get this error using the co-op on one of my sites:

    Because I try and make the ads visible, it's causing problems with stretching out a left navigation table for the error code.

    Any suggestions on how to correct?
     
    I. Brian, Sep 13, 2005 IP
  2. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There's already threads about this. It's to do with whatever software you run including the code twice. A search/browse should bring up the solution.
     
    T0PS3O, Sep 13, 2005 IP
  3. I. Brian

    I. Brian Business consultant

    Messages:
    810
    Likes Received:
    59
    Best Answers:
    1
    Trophy Points:
    145
    #3
    Thanks for the heads up - I realised that I'd left the echo statement in twice. I guess I forgot to evolve from the original version. :)
     
    I. Brian, Sep 13, 2005 IP
  4. I. Brian

    I. Brian Business consultant

    Messages:
    810
    Likes Received:
    59
    Best Answers:
    1
    Trophy Points:
    145
    #4
    Hmm, I'm still getting the error:

    I can assure you that I'm not calling up the file more than once - and as I'm trying to use the Co-op in a side nav to make it look more legitimate, whenever I can this error displayed it does awful things to my tables.

    I ran a search earlier and found that there seems to be a general problem with this happening, and no clear solution.

    Or have I misunderstood something fundamental?
     
    I. Brian, Sep 14, 2005 IP
  5. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #5
    A redeclare error only occurs when you redeclare something. That means it's already declared once, it simply HAS to be somewhere. To verify you can add to your PHP page at the top $redeclare_check = 0; Then in the Ad network code above line 4 add $redeclare_check++; and echo $redeclare_check;

    You will find (I'm 99% sure) a 1 and a 2 echoed on your site, maybe even more.

    Is your nav bar generated by means of a loop perhaps?
     
    T0PS3O, Sep 14, 2005 IP
  6. I. Brian

    I. Brian Business consultant

    Messages:
    810
    Likes Received:
    59
    Best Answers:
    1
    Trophy Points:
    145
    #6
    Thanks for the heads up - may have been user error - hopefully now corrected. :)
     
    I. Brian, Sep 18, 2005 IP
  7. I. Brian

    I. Brian Business consultant

    Messages:
    810
    Likes Received:
    59
    Best Answers:
    1
    Trophy Points:
    145
    #7
    Nope still having problems, and I can't find any instance of the code being called up twice.

    What I have is:

    Page A contains includes 1,2,3

    Include 2 calles up includes bob, carol, and max.

    Carol calls up includes file for the ad_network.


    So far as I can tell, for some reason that process makes PHP think it's being called up twice.

    *Maybe* there still is a basic and simple to address user error somewhere - but I simply cannot find reference to two includes for the adnetwork in the time being. Simply baffling.
     
    I. Brian, Sep 20, 2005 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    Well it's definitely being called twice *somewhere*. It could be whatever file has the include is being included more than once itself or something.
     
    digitalpoint, Sep 20, 2005 IP
  9. Imran

    Imran Notable Member

    Messages:
    2,340
    Likes Received:
    190
    Best Answers:
    0
    Trophy Points:
    230
    #9
    I have had the same error, in one my Directory where categories and subcategories are created as directories and static html pages were created using the same temlates [header,footer] and hence multiple declaration!
    To over come this problem I used shawns new way of using co-op on html pages and it works wonder!
     
    Imran, Sep 20, 2005 IP