homepage Welcome to WebmasterWorld Guest from 54.227.56.174
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

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
dkin




msg:3370704
 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>");
//-->
</script><noscript><a
href='http://www.example.com/adclick.php?n=6034c6'><img
src='http://www.example.com/adserve_rot.php?n=6034c6&type=banner&aff='
border='0' alt=''></a></noscript>

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

Thanks all

Dylan

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

 

vincevincevince




msg:3370788
 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