Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Javascript in php proxified page



6:50 am on Jun 18, 2007 (gmt 0)

10+ Year Member

Im trying to enter an ad code onto a proxified page, have been working on it for about 3 hours and cant seem to get it, any help is appreciated.

Here is the code

<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://www.example.com/adserve_rot.php?n=" + phpAds_random);
document.write ("&invoke=js");
document.write ("&type=banner");
document.write ("&aff=");
document.write ("&exclude=" + document.phpAds_used);
if (document.referer)
document.write ("&referer=" + escape(document.referer));
document.write ("'><" + "/script>");
border='0' alt=''></a></noscript>

Anyone know how I can echo that so it actually displays?

Thanks all


[edited by: dreamcatcher at 8:21 am (utc) on June 18, 2007]
[edit reason] Exemplified urls. [/edit]


8:48 am on Jun 18, 2007 (gmt 0)

WebmasterWorld Senior Member vincevincevince is a WebmasterWorld Top Contributor of All Time 10+ Year Member

It should work okay.

Try building the document.write strings into another variable, and then sending that variable to alert(); to verify what it's trying to read. (It is easier to read your raw logs, if you have access).

Check if that new URL is working properly - it should return some javascript - not a 404 page not found error.

Do you get any javascript errors when you access the page?


Featured Threads

Hot Threads This Week

Hot Threads This Month