Ad Impressions code not working?

Discussion in 'Co-op Advertising Network' started by matt6805, Apr 1, 2005.

  1. #1
    Hey gang. I've updated passthru.php to read as the following:


    <?php

    if (!function_exists('file_get_contents')) {
    function file_get_contents($url) {
    $handle = fopen($url, 'r');
    $string = fread($handle, 4096000);
    fclose($handle);
    return $string;
    }
    }

    include ('ad_network.php');
    echo preg_replace ("/<\/body>/i ", '<br><table width="800" cellpadding="0" cellspacing="0" border="0"><tr><td align="center"><font face="verdana" size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connections:&nbsp;&nbsp;' . $ad_network . ' | ' . $ad_network . ' | ' . $ad_network .' | '. $ad_network . ' | ' . $ad_network . '</font>' . '</td>' . '</tr><tr><td align="center"><font face="verdana" size="1"><a href="http://www.digitalpoint.com/tools/ad-network/?s=1103" target="_new">Digital Point</a></font></td></tr>' . '</table>' . '<br>' . '</body>', file_get_contents(str_replace ('../', '', $_REQUEST['file'])));


    ?>


    But the ads don't work. All I get is the word "Array", not a link. See the example on our website: www.sedonamonthly.com

    Any ideas what could be wrong :confused:

    Thanks in advance.
    Matt
     
    matt6805, Apr 1, 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
    Sounds like the ad_network PHP file did not get updated.
     
    digitalpoint, Apr 1, 2005 IP
  3. matt6805

    matt6805 Guest

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That was the ticket. Thanks for the quick response :D
     
    matt6805, Apr 1, 2005 IP
  4. jfontestad

    jfontestad Well-Known Member

    Messages:
    1,236
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    148
    #4
    matt you might want to change this
    echo preg_replace ("/<\/body>/i ", '<br><table width="800" cellpadding="0" cellspacing="0" border="0"><tr><td align="center"><font face="verdana" size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connections:&nbsp;&nbsp;' . $ad_network . ' | ' . $ad_network . ' | ' . $ad_network .' | '. $ad_network . ' | ' . $ad_network . '</font>' . '</td>' . '</tr><tr><td align="center"><font face="verdana" size="1"><a href="http://www.digitalpoint.com/tools/ad-network/?s=1103" target="_new">Digital Point</a></font></td></tr>' . '</table>' . '<br>' . '</body>', file_get_contents(str_replace ('../', '', $_REQUEST['file']))); 
    
    Code (markup):
    to this:

    echo preg_replace ("/<\/body>/i ", '<br><table width="800" cellpadding="0" cellspacing="0" border="0"><tr><td align="center"><font face="verdana" size="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connections:&nbsp;&nbsp;' . $ad_network . '</font>' . '</td>' . '</tr><tr><td align="center"><font face="verdana" size="1"><a href="http://www.digitalpoint.com/tools/ad-network/?s=1103" target="_new">Digital Point</a></font></td></tr>' . '</table>' . '<br>' . '</body>', file_get_contents(str_replace ('../', '', $_REQUEST['file']))); 
    Code (markup):
    That way it'll display different ads instead of the same ad like it's doing now.
     
    jfontestad, Apr 1, 2005 IP
  5. matt6805

    matt6805 Guest

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hey thanks for the help :p Your solution worked, but now it's just displaying one link. I'm not a PHP guy so I can't really think out the solution. Any ideas?
    Thanks again for your help.

    Matt
     
    matt6805, Apr 1, 2005 IP