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.

Php pointer "would this work"

Discussion in 'PHP' started by mr_bill, Apr 19, 2007.

  1. #1
    Here is what I want to do with a small network of 18 different domains.

    Would I be able to create a admin area on one domain we will can domain [A] in this admin area would have 2 files something like footerlinks.php and adsesne.php


    Now we have the other websites thru [Z] (I know more then 18 just an example) On website were you want the adsense to show up you would put something to the effect of echo or include to get the file adsesne.php from [A] and a certain line on adsense.php with the correct ads for ..

    So this way have all these sites I could just open the one file and add the adsense codes also the same idea with footerlinks.php for adding topsite links to all sites using one file.

    Just curious if I could pass this kind of information across to different domains on different servers.

    Hope this made sense.

    Thank You
     
    mr_bill, Apr 19, 2007 IP
  2. mr_bill

    mr_bill Banned

    Messages:
    1,292
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    135
    #2
    This would be in the adsense.php file
    <?php
    
    $ads1 = <script type="text/javascript"><!--
    google ad mumbo jumbo here
    </script>
    
    $ads2 = <script type="text/javascript"><!--
    google ad mumbo jumbo here
    </script>
    
    $ads3 = <script type="text/javascript"><!--
    google ad mumbo jumbo here
    </script>
    
    ?>
    Code (markup):
    Then this would be on website where the ad is suppose to show

    <?php
    
    include 'http://www.example.com/adsense.php?ads1';
    
    include 'http://www.example.com/adsense.php?ads2';
    
    include 'http://www.example.com/adsense.php?ads3';
    
    ?>
    Code (markup):
     
    mr_bill, Apr 19, 2007 IP
  3. Weizheng

    Weizheng Peon

    Messages:
    93
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you name the file adsense.php, it will be processed by the web server as a PHP file and when you include it in site B it'll not be what you want.

    Try renaming it to adsense.txt instead.
     
    Weizheng, Apr 20, 2007 IP
  4. Vetsin

    Vetsin Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You could use mySQL and write a script to read the database. Aka every adsense.php connects to a single mySQL database, which is the only thing you have to edit. Would work great for the topsite links.
     
    Vetsin, Apr 20, 2007 IP
  5. mr_bill

    mr_bill Banned

    Messages:
    1,292
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    135
    #5
    Anyone know what terms I would use to search for in google for samples of how this could be done using a text file? I want to figure this code out for myself.
     
    mr_bill, Apr 20, 2007 IP
  6. Weizheng

    Weizheng Peon

    Messages:
    93
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Try this:
    <?php
    $ads=$_REQUEST['ads'];
    
    if ($ads=='1')
        echo '<script type="text/javascript"> aaaa... </script>';
    else if ($ads=='2')
        echo '<script type="text/javascript"> bbbb... </script>';
    else
        echo 'Go to hell';
    ?>
    PHP:
    And include it this way
    
    include 'http://www.example.com/adsense.php?ads=1';
    
    include 'http://www.example.com/adsense.php?ads=2';
    
    include 'http://www.example.com/adsense.php?ads=3';
    PHP:
     
    Weizheng, Apr 21, 2007 IP
    mr_bill likes this.
  7. mr_bill

    mr_bill Banned

    Messages:
    1,292
    Likes Received:
    110
    Best Answers:
    0
    Trophy Points:
    135
    #7
    Thank you for trying. I am going to put this on hold tell I can find a freelancer I can hire to do this.
     
    mr_bill, Apr 21, 2007 IP