Warning : Division by zero - same Error message

Discussion in 'Co-op Advertising Network' started by the-kids, Jan 31, 2007.

  1. #1
    I always get Error message

    Warning: Division by zero in /maypath/path/path1/ad_network_153.php line 78

    I tried in different website; Wordpress, Php site; and the same error show up.
    And then when I removed that line(78), the ads show without error but it can't be validate.

    The line 78
    
    $ads_next = (hexdec(substr(md5($_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'] . $_SERVER['QUERY_STRING']), 0, 5)) % (count($ads) - 1 - $ads_x)) + 1;
    
    Code (markup):
    any suggestion to solve this problem?

    Thank's In Advance.
     
    the-kids, Jan 31, 2007 IP
  2. Kalyse

    Kalyse Peon

    Messages:
    1,221
    Likes Received:
    24
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hello.

    I am not going to look at that code, it would hurt my heard.

    But you know you cant divide by zero right?

    Its just logically impossible.

    I think whats happening is one of the variables is missing of something.

    Try debugging each value and then working it out one by one.
     
    Kalyse, Jan 31, 2007 IP
  3. yipesft

    yipesft Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Same thing happened to me after I followed the exact instructions on the setup instructions page:

    http://www.digitalpoint.com/tools/ad-network/setup.php?type=99

    Maybe this only happens for new sites as they get validated and setup? Hmm, any suggestions?

    -Kevin
     
    yipesft, Jul 15, 2007 IP
  4. yipesft

    yipesft Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I changed to text only links and also changed the "separate ads with" field and no longer get the divide by zero error.

    Although my ads don't seem to be text only links. Still getting some text banners.
     
    yipesft, Jul 15, 2007 IP
  5. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #5
    Just "flush" your ads .txt file, replace it with an empty one
     
    fryman, Jul 16, 2007 IP
  6. swerdstone

    swerdstone Guest

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi,

    The-kids, finally how did you fix this problem? I am encountering exactly the same issue and I am seeking for some help.
     
    swerdstone, Jan 10, 2008 IP
  7. Phaethon

    Phaethon Peon

    Messages:
    113
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Moving the one inside the parenthesis might stop the problem. I'm thinking it is with your vars though.
     
    Phaethon, Jan 10, 2008 IP
  8. JohnG

    JohnG Peon

    Messages:
    150
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I tried that but nothing changed
     
    JohnG, Feb 9, 2008 IP