Trouble with PHP Ad Codes

Status
Not open for further replies.

moberemk

New Member
Messages
40
Reaction score
0
Points
0
PHP:
<?php

echo "<script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'>\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>[img]http://x10hosting.com/advert/adview.php?what=zone:1&n=a7fb3e9d[/img]\n";

echo "<br>


\n";

?>
When I try to use this code in my include file for the header, nothing happens. Is it because I've been running it off of my home testing server?
 

Stiv_

Banned
Messages
290
Reaction score
0
Points
0
are u sing phpnuke? if so upload yer Php Ad Codes.php to yer main nuke directory and find these lines in the header.php

function head() {
global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
include("includes/ipban.php");
$ThemeSel = get_theme();
include("themes/$ThemeSel/theme.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";

after that add include("Php Ad Codes.php"); so it shud looklike this

function head() {
global $slogan, $sitename, $banners, $nukeurl, $Version_Num, $artpage, $topic, $hlpfile, $user, $hr, $theme, $cookie, $bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4, $textcolor1, $textcolor2, $forumpage, $adminpage, $userpage, $pagetitle;
include("includes/ipban.php");
$ThemeSel = get_theme();
include("themes/$ThemeSel/theme.php");
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
include("Php Ad Codes.php");
echo "<title>$sitename $pagetitle</title>\n";
include("includes/meta.php");
include("includes/javascript.php");
 

moberemk

New Member
Messages
40
Reaction score
0
Points
0
No, I'm using a CMS of my own devising. However, by removing the text link codes and making the PHP file into it's own includes file, then I should be able to get it to work...
But it didn't, and when I go to my page (http://www.umsd.x10hosting.com/) where the banners should be in the top-right, it just doesn't work, and it gets that error message.
[EDIT] By changing the method that I use to include the file, I got rid of the error, and now only get a little piece of text that says "Large Corporate Banner," but no banner. Strange, isn't it? I use
PHP:
<?php 

echo "Large Banner (Corporate)<br><br>\n";

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";

echo "<br><br><br><br>\n";
?>
in my include file. Is it neccessary to keep the "Large Corporate Banner" text at the top?
 
Last edited:

Stiv_

Banned
Messages
290
Reaction score
0
Points
0
no thats just there to let u no which code is which. i unno y yer sites bn directed to http:/// codein looks fine to me. maybe be safer waitin on a reply from some1 thats been in the same situation or is more educated on cms? best i cud come up with sorry as i aint to familiar with cms!
 
Last edited:

moberemk

New Member
Messages
40
Reaction score
0
Points
0
Well, let's just say that no one else has a CMS quite like this one. But essentially, underneath that text that say Large Corporate Banner there should be advertisements. However, I've blocked most advertisements with filters, so that may be it.
EDIT: I've looked it up, and I've determined that my ad filters were affecting it. However, what most concerns me is the fact that the advertisements are appearing at the very top of the page, and not next to the logo where they're supposed to be. Does anyone know why?
 
Last edited:

moberemk

New Member
Messages
40
Reaction score
0
Points
0
Alright, I managed to use an IFrame to get it to where it's supposed to be. Now that advertising is completed, I can focus on other parts of the site. Thanks for the help!
 
Last edited:

ther1clan

New Member
Messages
20
Reaction score
0
Points
0
i did that but my banner is not showing up... i left the large banner thing up to show where it should be under that??
 

moberemk

New Member
Messages
40
Reaction score
0
Points
0
What? Why are you posting in this topic? Did you respond to it incorrectly?
But anyways, I just made it an IFrame that takes it's source from an HTML file with the html code for it. It worked for me, as you can see at the link provided above.
 

brycepsx

New Member
Messages
12
Reaction score
0
Points
0
I am Having trouble getting the ads to work... i put the code in unedited but they aren't showing up.
 

oab

New Member
Messages
918
Reaction score
0
Points
0
just a thought, you might want to use a div instead of an iframe..
 
Status
Not open for further replies.
Top