Chris
New Member
- Messages
- 1,538
- Reaction score
- 0
- Points
- 0
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)
Medium Banner(x10Advanced)
Large Banner (x10Corporate)
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/javascript-php.html.
More tutorials coming soon as described above.
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 (\"&what=zone:3&target=_blank\");\n";
echo "document.write (\"&exclude=\" + document.phpAds_used);\n";
echo "if (document.referrer)\n";
echo "document.write (\"&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&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 (\"&what=zone:2&target=_blank\");\n";
echo "document.write (\"&exclude=\" + document.phpAds_used);\n";
echo "if (document.referrer)\n";
echo "document.write (\"&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&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 (\"&what=zone:1&target=_blank\");\n";
echo "document.write (\"&exclude=\" + document.phpAds_used);\n";
echo "if (document.referrer)\n";
echo "document.write (\"&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&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/javascript-php.html.
More tutorials coming soon as described above.
Last edited: