1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Ad network error - "can't write to file..."

Discussion in 'Co-op Advertising Network' started by scottjmurray, Jan 13, 2008.

  1. #1
    Whenever I set up the ad code, I get the error:

    You must set the ad_network_ads_135.txt file to be writable (check file name as well).

    on the page. Yes, I did set the file ad_networks_ads_135.txt to be writeable (chmod 777). Yes, all the file names are correct. Yes, they're all in the same directory. Am I missing something?
     
    scottjmurray, Jan 13, 2008 IP
  2. anarmyofme

    anarmyofme Well-Known Member

    Messages:
    1,136
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    130
    #2
    Remember that there is a php file and a txt file. Check again to see if you changed the wrong one.
     
    anarmyofme, Jan 13, 2008 IP
  3. scottjmurray

    scottjmurray Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    both are uploaded and exactly where they should be. filenames are correct. i am baffled.
     
    scottjmurray, Jan 14, 2008 IP
  4. anarmyofme

    anarmyofme Well-Known Member

    Messages:
    1,136
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    130
    #4
    Another thing to check:

    Look at your .txt destination path in the php file and make sure that it points to the right path (where it is located).
     
    anarmyofme, Jan 14, 2008 IP
  5. scottjmurray

    scottjmurray Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yep, it points to it. I'm assuming this line of php stuff is it:

    if (!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;

    $ad_file = 'ad_network_ads_135.txt';
    for ($i = 0; $i <= 11; $i++) {
    $path = substr ('../../../../../../../../../../', 0, $i * 3);
    if (file_exists ($path . $ad_file)) {
    $ad_file = $path . $ad_file;
    break;
    }

    So... that would mean they would need to be in the same directory right? And they are.. I'm about ready to give up on the concept.
     
    scottjmurray, Jan 15, 2008 IP
  6. anarmyofme

    anarmyofme Well-Known Member

    Messages:
    1,136
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    130
    #6
    I am not an expert with this by any means, but I saw that no one else jumped in. Only other thing I would think to try is to change:


    $ad_file = 'ad_network_ads_135.txt';

    to


    $ad_file = 'http://yourdomain/ad_network_ads_135.txt';
     
    anarmyofme, Jan 15, 2008 IP
  7. bidder

    bidder Active Member

    Messages:
    431
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    #7
    is this you root directory. from what i can see you have 10 folder/directory before to it actual file.
    root directory normally located here: public_html

    look at mine:
    <!-- start_co_op_network -->
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../../:../');
    include ('ad_network_140.php');
    echo $ad_network;
    ?>
    <!-- end_co_op_network-->
     
    bidder, Jan 19, 2008 IP
  8. canonsky

    canonsky Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    i have a same problem then i reduce the number of path search looping like this

    for ($i = 0; $i <= 3; $i++) {
    //$path = substr ('../../../../../../../../../../', 0, $i * 3);
    $path = substr ('../../', 0, $i * 3);
    if (file_exists ($path . $ad_file)) {
    $ad_file = $path . $ad_file;
    break;
    }
    }

    and it's work. i don't know why 11 looping make it not work.
     
    canonsky, Feb 13, 2009 IP