homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

Javascript in php proxified page

10+ Year Member

Msg#: 3370702 posted 6:50 am on Jun 18, 2007 (gmt 0)

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]



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

Msg#: 3370702 posted 8:48 am on Jun 18, 2007 (gmt 0)

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?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved