more sophisticated code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

more sophisticated code

Post by Vegan »

Been working with XML a bit more and I found something that might have some potential

Code: Select all

    // http://www.amazon.com/dp/YOUR10DIGITASIN
    var xmlhttp = new XMLHttpRequest();
    var url = "http://www.amazon.com/dp/" + AISN
    xmlhttp.open("GET", url, true);
    xmlhttp.onreadystatechange=function() {
	    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			temp = '<iframe src="http://rcm-na.amazon-adsystem.com/e/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=cpa07-20&o=1&p=8&l=as4&m=amazon&f=ifr&ref=ss_til&asins=';
			temp += AISN;
			temp += '" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>';
			document.write(temp+='\n');
	    }
	}
this the right idea?
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: more sophisticated code

Post by Celauran »

It's unclear what specifically you're trying to accomplish, so it makes it hard to say whether or not that's the right idea. Two things immediately come to mind, though. 1. That's an awful lot of hardcoded values. 2. XML? Really? Is JSON not available?
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: more sophisticated code

Post by Vegan »

I was wanting to check to see that a given product is still in the catalog before showing an ad
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: more sophisticated code

Post by Benjamin »

I would focus more on getting click throughs so your referral cookie is set; because it doesn't matter what they buy, you'll get a kickback.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: more sophisticated code

Post by Vegan »

I am also experimenting with some other ad ideas, when in doubt add more code
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply