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 Code to display randomly sized AdSense blocks.

Discussion in 'AdSense' started by JamesColin, Apr 25, 2006.

  1. tomzx

    tomzx Peon

    Messages:
    385
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #21
    They are actually called heredocs.

    <?php
    $menu_html = <<<MENU_DATA
      <div id="menu">
      <strong>Menu</strong>
      <a href="index.htm">Home Page</a>
      <a href="articles.htm">Articles</a>
      <a href="links.htm">Links</a>
      <a href="forums/" title="Discuss anything in our forums!">Forums</a>
      </div>
    MENU_DATA;
    ?>
    HTML:

     
    tomzx, Apr 29, 2006 IP
  2. mariush

    mariush Peon

    Messages:
    562
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #22
    The "<<<" thing works on all PHP versions, 4 or 5, it doesn't matter.

    CODE cand be replaced with any name you wish, but the same word must be used at the end.

    See this for documentation :

    http://www.onlamp.com/pub/a/php/2003/04/10/php_heredocs.html

    Google has no way to determine if the code was pasted directly from the site or not.

    Changing colors may be a good thing if your site's users have "ad blindness".
     
    mariush, May 1, 2006 IP
  3. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #23
    Hello, I've found this thread this morning, for people who think that using PHP is not allowed and who think that when Google says to copy & paste the code means don't use anything else than copy and paste or includes, someone actually asked Google:
    http://forums.digitalpoint.com/showthread.php?t=81358

    For the lazy, the answer is yes you can, of course. :)
     
    JamesColin, May 4, 2006 IP
  4. jumble

    jumble Peon

    Messages:
    142
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #24
    thanks james! it only makes sense that Google agrees with you ....hopefully others will LISTEN and stop scaring new users into tip toeing around the TOS like mice in a cattery! :)
    :p
     
    jumble, May 5, 2006 IP