+ Reply to Thread
Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: [PHP] Placing the Ads in PHP Pages

  1. #1
    Chris's Avatar
    Chris is offline x10 Elder Chris is an unknown quantity at this point
    Join Date
    Feb 2005
    Posts
    769

    [PHP] Placing the Ads in PHP Pages

    For some reason, I am totally running out of time today, for pretty much everything I do, hehe... First I am going to create a simple tutorial on how to place the ads in PHP pages. Then I will look through the forums and look for other problems people are finding for ads and add that. A super tutorial!

    PLACING THE ADS IN PHP PAGES

    In order to use javascript is PHP pages, you have to modify it a little. You have to do all of the following:
    Add echo" to the start of each javascript line
    Add \n to the end of each javascript line
    Add "; to the very end of each javascript line
    Escape all double quotes (") by adding a backslash (\) before them

    Notice how this can be very tedios to do if you have a large piece of javascript. So, I have written a very basic/easy program to automate this process. These are the ad codes to use if you want to put the ads in PHP pages:

    Text Link(x10Static)
    Code:
    echo "<script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>\n";
    echo "<script language='JavaScript' type='text/javascript'>\n";
    echo "<!--\n";
    echo "if (!document.phpAds_used) document.phpAds_used = ',';\n";
    echo "phpAds_random = new String (Math.random());\n";
    echo "phpAds_random = phpAds_random.substring(2,11);\n";
    echo "document.write (\"<\" + \"script language='JavaScript' type='text/javascript' src='\");\n";
    echo "document.write (\"http://x10hosting.com/advert/adjs.php?n=\" + phpAds_random);\n";
    echo "document.write (\"&amp;what=zone:3&amp;target=_blank\");\n";
    echo "document.write (\"&amp;exclude=\" + document.phpAds_used);\n";
    echo "if (document.referrer)\n";
    echo "document.write (\"&amp;referer=\" + escape(document.referrer));\n";
    echo "document.write (\"'><\" + \"/script>\");\n";
    echo "//-->\n";
    echo "</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a915c788' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:3&amp;n=a915c788' border='0' alt=''></a></noscript>\n";
    echo "\n";
    echo "\n";
    Medium Banner(x10Advanced)
    Code:
    echo "<script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>\n";
    echo "<script language='JavaScript' type='text/javascript'>\n";
    echo "<!--\n";
    echo "if (!document.phpAds_used) document.phpAds_used = ',';\n";
    echo "phpAds_random = new String (Math.random());\n";
    echo "phpAds_random = phpAds_random.substring(2,11);\n";
    echo "document.write (\"<\" + \"script language='JavaScript' type='text/javascript' src='\");\n";
    echo "document.write (\"http://x10hosting.com/advert/adjs.php?n=\" + phpAds_random);\n";
    echo "document.write (\"&amp;what=zone:2&amp;target=_blank\");\n";
    echo "document.write (\"&amp;exclude=\" + document.phpAds_used);\n";
    echo "if (document.referrer)\n";
    echo "document.write (\"&amp;referer=\" + escape(document.referrer));\n";
    echo "document.write (\"'><\" + \"/script>\");\n";
    echo "//-->\n";
    echo "</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a4f0eec1' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:2&amp;n=a4f0eec1' border='0' alt=''></a></noscript>\n";
    echo "\n";
    echo "\n";
    Large Banner (x10Corporate)
    Code:
    echo "<script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>\n";
    echo "<script language='JavaScript' type='text/javascript'>\n";
    echo "<!--\n";
    echo "if (!document.phpAds_used) document.phpAds_used = ',';\n";
    echo "phpAds_random = new String (Math.random());\n";
    echo "phpAds_random = phpAds_random.substring(2,11);\n";
    echo "document.write (\"<\" + \"script language='JavaScript' type='text/javascript' src='\");\n";
    echo "document.write (\"http://x10hosting.com/advert/adjs.php?n=\" + phpAds_random);\n";
    echo "document.write (\"&amp;what=zone:1&amp;target=_blank\");\n";
    echo "document.write (\"&amp;exclude=\" + document.phpAds_used);\n";
    echo "if (document.referrer)\n";
    echo "document.write (\"&amp;referer=\" + escape(document.referrer));\n";
    echo "document.write (\"'><\" + \"/script>\");\n";
    echo "//-->\n";
    echo "</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>\n";
    In order for this to work properly, you have to include this in the php tags (<?php and ?>), in a PHP or HTML page. Although, if you are using an HTML page, just use the regular code...

    I have found out how to do this by searching google and by find this page: http://www.karakas-online.de/EN-Book...cript-php.html.

    More tutorials coming soon as described above.
    Last edited by Chris; 03-01-2005 at 10:03 PM.

  2. #2
    Tyler's Avatar
    Tyler is offline Retired Staff Tyler is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    Michigan, USA
    Posts
    4,282
    Wow, Thanks for that! Unfortunatly it did not work for me, but im sure its just me im probly doing somthing wrong Good work!
    The Sims 2 Extreme | TTECH - Work In Progress

    E-Mail Me | PM Me

  3. #3
    Chris's Avatar
    Chris is offline x10 Elder Chris is an unknown quantity at this point
    Join Date
    Feb 2005
    Posts
    769
    Quote Originally Posted by thesims2extreme
    Wow, Thanks for that! Unfortunatly it did not work for me, but im sure its just me im probly doing somthing wrong Good work!
    What's the problem? What page did you insert it in?

  4. #4
    Tyler's Avatar
    Tyler is offline Retired Staff Tyler is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    Michigan, USA
    Posts
    4,282
    I PMed you, Thanks again for your help its very much appreciated
    The Sims 2 Extreme | TTECH - Work In Progress

    E-Mail Me | PM Me

  5. #5
    johndoe is offline x10Hosting Member johndoe is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    Chile
    Posts
    25
    the problem is with php nuke. Becuse the best place to place the add is on the header.html file that comes whit teh theme of cyour choise. but echo tags an javascrip tags didn't work

  6. #6
    Chris's Avatar
    Chris is offline x10 Elder Chris is an unknown quantity at this point
    Join Date
    Feb 2005
    Posts
    769
    Oh yea... I made a mistake. You use the normal tags for PHP-Nuke.

  7. #7
    johndoe is offline x10Hosting Member johndoe is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    Chile
    Posts
    25
    yes, but the problem is that i do not understand php nuke because the header is an html file, and when i put html tags like
    Code:
    <script></script>>
    , the add don't appear.

  8. #8
    Chris's Avatar
    Chris is offline x10 Elder Chris is an unknown quantity at this point
    Join Date
    Feb 2005
    Posts
    769
    Quote Originally Posted by johndoe
    yes, but the problem is that i do not understand php nuke because the header is an html file, and when i put html tags like
    Code:
    <script></script>>
    , the add don't appear.
    Are you putting the code in the body? It should work because I myself has got it to work in PHP-Nuke.

  9. #9
    prasys's Avatar
    prasys is offline x10 Sophmore prasys is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    Malaysia
    Posts
    165
    PHP Code:
    <html>
    <?php
    switch($_GET['id'])
    {
    case 
    "corporate":
    ?>

    <script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>
    <script language='JavaScript' type='text/javascript'> 
    <!-- 
    if (!document.phpAds_used) 
    document.phpAds_used = ','; 
    phpAds_random = new String (Math.random());
    phpAds_random = phpAds_random.substring(2,11);
    document.write ("<" + "script language='JavaScript' type='text/javascript' src='"); 
    document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random); 
    document.write ("&amp;what=zone:1&amp;target=_blank"); 
    document.write ("&amp;exclude=" + document.phpAds_used); 
    if (document.referrer) 
    document.write ("&amp;referer=" + escape(document.referrer)); 
    document.write ("'><" + "/script>"); 
    //--> 
    </script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>

    <?php
    break;
    case 
    "advanced":
    ?>

    <script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script> 
    <script language='JavaScript' type='text/javascript'> 
        if (!document.phpAds_used) document.phpAds_used = ',';
        phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
        document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
        document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random); 
        document.write ("&amp;what=zone:2&amp;target=_blank"); document.write ("&amp;exclude=" + document.phpAds_used); 
        if (document.referrer)
            document.write ("&referer=" + escape(document.referrer));
        document.write ("'><" + "/script>"); 
    </script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a4f0eec1' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:2&n=a4f0eec1' border='0' alt=''></a></noscript>

    <?php
    break;
    case 
    "static":
    ?>

    <script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script> 
    <script language='JavaScript' type='text/javascript'> 
    <!-- 
    if (!document.phpAds_used) document.phpAds_used = ','; 
    phpAds_random = new String (Math.random()); 
    phpAds_random = phpAds_random.substring(2,11); 
    document.write ("<" + "script language='JavaScript' type='text/javascript' src='"); 
    document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random); 
    document.write ("&amp;what=zone:3&amp;target=_blank"); 
    document.write ("&amp;exclude=" + document.phpAds_used); 
    if (document.referrer) 
    document.write ("&amp;referer=" + escape(document.referrer));
    document.write ("'><" + "/script>"); 
    //--> 
    </script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a915c788' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:3&amp;n=a915c788' border='0' alt=''></a></noscript>

    <?php
    break;
    }
    ?>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Coming Soon</title>
    </head>
    <script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script> <script language='JavaScript' type='text/javascript'> <!-- if (!document.phpAds_used) document.phpAds_used = ','; phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11); document.write ("<" + "script language='JavaScript' type='text/javascript' src='"); document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random); document.write ("&amp;what=zone:1&amp;target=_blank"); document.write ("&amp;exclude=" + document.phpAds_used); if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer)); document.write ("'><" + "/script>"); //--> </script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>
    <body>
    <script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script> <script language='JavaScript' type='text/javascript'> <!-- if (!document.phpAds_used) document.phpAds_used = ','; phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11); document.write ("<" + "script language='JavaScript' type='text/javascript' src='"); document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random); document.write ("&amp;what=zone:1&amp;target=_blank"); document.write ("&amp;exclude=" + document.phpAds_used); if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer)); document.write ("'><" + "/script>"); //--> </script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>
    <p>Coming Soon..I'm working on a True Mac Site ! </p>
    <script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script> <script language='JavaScript' type='text/javascript'> <!-- if (!document.phpAds_used) document.phpAds_used = ','; phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11); document.write ("<" + "script language='JavaScript' type='text/javascript' src='"); document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random); document.write ("&amp;what=zone:1&amp;target=_blank"); document.write ("&amp;exclude=" + document.phpAds_used); if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer)); document.write ("'><" + "/script>"); //--> </script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>
    <script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script> <script language='JavaScript' type='text/javascript'> <!-- if (!document.phpAds_used) document.phpAds_used = ','; phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11); document.write ("<" + "script language='JavaScript' type='text/javascript' src='"); document.write ("http://x10hosting.com/advert/adjs.php?n=" + phpAds_random); document.write ("&amp;what=zone:1&amp;target=_blank"); document.write ("&amp;exclude=" + document.phpAds_used); if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer)); document.write ("'><" + "/script>"); //--> </script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>
    </body>

    </html>
    This is a Sample Code for coding in Frontpage..Hopefully that should help you users that use Frontpage (should work in Windows aswell)..:D
    I am the Spammer dude , that will spam you...:D Ha Ha

    Spam Rulez..If you think I am rude , dial 1-555-9594871 and make a complaint..You will be happy :D

  10. #10
    Kalim3ru is offline x10Hosting Member Kalim3ru is an unknown quantity at this point
    Join Date
    Feb 2005
    Location
    @ space
    Posts
    8
    What about Coppermine Photo Gallery?

    I'm using it in my webpage, with the theme Hardwired...Does anyone know how to put the ad code on the header??

+ Reply to Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 08:27 AM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 10:46 AM
  3. how can i convert Php pages and code into asp pages and code
    By n4tec in forum Scripts & 3rd Party Apps
    Replies: 11
    Last Post: 01-10-2009, 10:40 PM
  4. [PHP] PHP For Starters
    By Complex in forum Tutorials
    Replies: 24
    Last Post: 06-15-2008, 12:40 AM
  5. Unstand PHP?
    By o0slowpaul0o in forum Tutorials
    Replies: 8
    Last Post: 01-07-2008, 10:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers