Forum Moderators: open

Message Too Old, No Replies

How to identify if my site is loaded in a frame?

Affiliate can include my "normal" content in a frame, howto tell?

         

AcsCh

11:44 pm on Nov 24, 2005 (gmt 0)

10+ Year Member



We are working on an affiliate program, where other sites can include our content on their sites in a frame. We intend to take all mention of our site away if this page is loaded in an affiliate frame, to give our affiliate the business, and not compete directly.

We use php, and my question now: how does a webpage know that it is loaded in a frame, resp. to know what is the frameset page including this frame, (except via referer) to know on *which* affiliate site it is included, and on top *if* it is on an affiliate site?

Thanks a lot for any ideas.

encyclo

6:14 pm on Nov 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not aware of any server-side (PHP) method for detecting a frame - you can only do this client-side with Javascript. You could detect whether the page is within a frame and dependent on the result add or remove the visibility of certain elements on the page. One thing to consider is what will happen if the user has Javascript disabled - you will probably have to display your logos etc. by default.

otc_cmnn

6:55 pm on Nov 25, 2005 (gmt 0)

10+ Year Member



IF the issue is tracking the frame elements to the parent affiliate than just make sure that affiliate id's are passed through the frame request.

<frameset rows="100%,*" FRAMEBORDER=NO FRAMESPACING=0 BORDER=0>
<frame src="http://www.yourdomain.com/yopurpage.php?aff_id=abc123" FRAMEBORDER=NO>
<frame FRAMEBORDER=NO>
</frameset>

Then set the cookie and you are off to the races - is done all the time. But I'm not sure if that is your question/issue.

AcsCh

8:42 pm on Nov 30, 2005 (gmt 0)

10+ Year Member



Thanks a lot for your replays! As we would NOT like to display our logo on the affiliate site, javascript is not an option to switch it off, (if the visitor has it off, he will see our logo), the rest we will handle over sessions with cookies.