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.

Problems including via php method

Discussion in 'Co-op Advertising Network' started by buyoffit, Dec 11, 2004.

  1. #1
    hiya,
    Got a bit of a problem, got the file on the route dir, but when you go down a certain amount of levels it fails to include it, is there a way of setting it to include

    i.e: http://www.domain.com/file.php

    rather than all the :
    ("include_path") . ':../:../../:../../../:../../../../');

    Tried this :

    <?php
    include('http://www.domain.co.uk/file.php');
    echo "<div><p>Some other internet browsing ideas:</p></div>";
    echo '<p>'.$ad_network[0].' / '.$ad_network[1].' / '.$ad_network[2].' / '.$ad_network[3].' / '.$ad_network[4].'</p>';

    ?>

    but it brings back no results. no parse errors etc..

    Any ideas?

    Edit : To illaborate, is there a fixed path method? that appears to be where the problem is, i tried modifying it to use a fixed path my self, but then it doesnt return anything, it returns the slashes and anything else i manually pu t there so it is executing it properly, just not using it properly since theres no include error.

    Cheers
     
    buyoffit, Dec 11, 2004 IP
  2. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #2
    you are on the right track. You need the full server path to the file. So, if you are in the directory where the ads file is, type pwd . That will give you the present working directory and the full path to that directory. Enter that path in before the file name rather than the http:// example you did earlier.
     
    chachi, Dec 11, 2004 IP
  3. buyoffit

    buyoffit Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    nice one Chachi, working perfect now, buyoffit.co.uk if ya interested. (live links not available till 10 posts so umm :) )

    For those wishing to do the same thing, make a whatever.php page, put in it: <?phpinfo()?> only, nothing else, run the php file and scroll down prolly about half way to find the server path.

    Then in the include ya using do:

    <div style="width: 350px;"><?php
    include ('/your/server/path/ad_network.php');
    echo "<div><p>Some other internet browsing ideas:</p></div>";
    echo '<p>'.$ad_network[0].' / '.$ad_network[1].' / '.$ad_network[2].' / '.$ad_network[3].' / '.$ad_network[4].'</p>';

    ?></div>

    Or if you want to display only one ad use:

    echo '<p>'.$ad_network[0].'</p>';

    =)
     
    buyoffit, Dec 11, 2004 IP