No ads showing, just the PHP code.

Discussion in 'Co-op Advertising Network' started by stfarm, Mar 7, 2005.

  1. #1
    Hi,

    now sure what I am doing wrong, but my ads are not showing. I am on a windows host, but php is enabled. My posters link is all php.
    Please let me know what I should do. :confused:

    Thank you.

    Here is the code that is showinf on the bottom of my page.

    ', $ads); $ads_temp = explode ('|', $ads[0]); $file = fopen($ad_file, 'r+'); if (flock ($file, LOCK_EX|LOCK_NB, $would_block) && !$would_block) { if ((count ($ads) < $ads_temp[3] + 1 && $ads_temp[0] + $ads_temp[5] < time()) || $ads_temp[0] + $ads_temp[4] < time()) { $new_ad = file_get_contents ('http://ads.digitalpoint.com/network.php?b=' . $_SERVER['SERVER_NAME'] . '&type=link'); if ($new_ad) { $ads_param = explode ('' , $new_ad); $new_ad = $ads_param[1]; unset ($ads_param[1]); $ads_temp = explode ('|', $ads_temp[0] . '|' . $ads_temp[1] . '|' . $ads_param[0]); } else { $ads_param = array_slice ($ads_temp, 2, 4); } $ads[0] = time() . '|' . gethostbyname('validate.digitalpoint.com') . '|' . implode ('|', $ads_param); if ($new_ad) { $ads[] = $new_ad; if (count ($ads) > $ads_temp[3] + 1) $ads = array_merge ((array)$ads[0], (array)array_slice ($ads, -$ads_temp[3])); } fwrite ($file, implode ('', $ads)); ftruncate ($file, ftell($file)); $ad_network[] = $new_ad; } flock ($file, LOCK_UN); fclose ($file); } while (count ($ad_network) < 5) { $ad_network[] = $ads[mt_rand(1,count($ads) - 1)]; } foreach ($ad_network as $key => $ad) { if ($ads_temp[1] == $_SERVER['REMOTE_ADDR'] || $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR']) { $ad_network[$key] = str_replace ('" />', '" class="' . $ads_temp[2] . '" />', $ad); } else { $ad_network[$key] = str_replace ('" />', '">', $ad); } } } else { $ad_network[] = 'You must set the ad network .txt file to be writable.'; } if (substr (@$_SERVER['DOCUMENT_NAME'], -6) == '.shtml') { ini_set ('zlib.output_compression', 0); echo end ($ad_network); } ?>
     
    stfarm, Mar 7, 2005 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Well for whatever reason your server is not parsing it as PHP. If you have a URL, someone could look at it.
     
    digitalpoint, Mar 7, 2005 IP
  3. stfarm

    stfarm Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes, here we go.

    www shopherenow net

    Thank you
     
    stfarm, Mar 9, 2005 IP
  4. a389951l

    a389951l Must Create More Content

    Messages:
    1,885
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    140
    #4
    I think you need to re-read the setup directions. The code you inserted needs to be a separate .php file on your webserver. Step 1.

    Step 4. has the code to put on your pages if your IIS server supports php.
     
    a389951l, Mar 9, 2005 IP