Support » Plugins » PHP code in Adsense Plugin

  • Aloha,

    I have added Phil Hord’s Adsense plugin to my new blog and would like to use it to display random ads from Adsense and others.

    I’m thinking that I should be able to add some PHP code to the Adsense section in the plugin file, but it doesn’t want to execute my code 🙁

    I have added the following code:
    $adsense_code = '
    <!-- Begin Google Adsense code -->
    $random = (rand()%9);
    print("Random is: $random");
    <!-- End Google Adsense code -->

    This displays CODE1 in my posts, but not the random number and CODE2. I have installed PHP Exec in my attempt to make it work, but that didn’t change anything.


  • The topic ‘PHP code in Adsense Plugin’ is closed to new replies.