light87 Posted June 2, 2010 Share Posted June 2, 2010 I have a Website that has several affiliate links that I would like to cloak. More specifically, when a user clicks on one of the links, I would like the Web Browser to reveal a URL that does not have "affiliate" in the name. My Website is http://www.website-kept-private.com, which is a fictitious Website (I have kept the true name of the Website private to keep in accordance with the terms of this forum). I wish to use PHP coding to employ a link (not an entire page or Website) redirect on one of the pages. <p>This is a great opportunity, <a href="http://www.website-kept-private.com/recommends/software-mobile/index.php">so forth and so on</a></p> Obviously, I created two sub-directories in the Website: The 1st is "recommends", and the 2nd is "software-mobile". The file "index.php" is placed under the "software-mobile" sub-directory. The entire coding for "index.php" is: <?php header("Location: http://Affiliatexyz123.Product-To-Sell.hop.clickbank.net/"); exit; ?> Of course, Affiliatexyz123 is a fictitious Affiliate I.D. Of course, Product-To-Sell is a fictitious product. This shows up on the bottom when you mouse over either the link or the picture: http://www.website-kept-private.com/recommends/software-mobile/index.php This shows up in the URL address when you click on the link or the icon: http://Product-To-Sell.com/?hop=Affiliatexyz123 The goal is that when the user clicks on the link, that "http://www.website-kept-private.com/recommends/software-mobile" shows up in the URL address, instead of revealing the Affiliate I.D. (which is Affiliatexyz123). Unfortunately, it doesn't. I have Linux hosting through GoDaddy. It seems as though GoDaddy only supports entire page redirects or entire Website redirects. Maybe I'm wrong. If GoDaddy does not support single link redirects, who does? I would appreciate the help. Link to comment https://forums.phpfreaks.com/topic/203599-cloaking-affiliate-links/ Share on other sites More sharing options...
lostnucleus Posted June 2, 2010 Share Posted June 2, 2010 following sol are possible if you dnt have controle over site http://Product-To-Sell.com/ a) use iframe b)buy new domain and use masked domain forwarding. (name.com gives this option for free) Link to comment https://forums.phpfreaks.com/topic/203599-cloaking-affiliate-links/#findComment-1066513 Share on other sites More sharing options...
light87 Posted June 2, 2010 Author Share Posted June 2, 2010 Hello: I thought that use of Iframes blocks google and other entities from crawling your site. I forgot to mention that I have several different links that sell different products from different Websites. Buying a new Domain name is not an option if you want to sell more than one product on each page, and the links go to different Websites. I would appreciate the help. Link to comment https://forums.phpfreaks.com/topic/203599-cloaking-affiliate-links/#findComment-1066521 Share on other sites More sharing options...
lostnucleus Posted June 2, 2010 Share Posted June 2, 2010 simply declare meta tags <html> <head> <title>My site name</title> <meta name="description" value="som discription"> <meta nam="keywords" value="apple,oranges"> </head> <frameset rows="100%" border="0"> <frame noresize="noresize" src="http://some-affilitat.com/?code=45> <noframes> <body>Sorry your browser does not support frames</body> </noframes> </frameset> </html> meta tags will make your page accessable to google , all you need to do is change src attribute of frame tag using php and then throw the output to the client. and the best part you dnt even need to purchase domain if you can implement all this properly . Link to comment https://forums.phpfreaks.com/topic/203599-cloaking-affiliate-links/#findComment-1066533 Share on other sites More sharing options...
light87 Posted June 2, 2010 Author Share Posted June 2, 2010 Hello: You stated: "...all you need to do is change src attribute of frame tag using php..." How do you change the src attribute of frame tag using php? In other words, what is the php coding to accomplish this? Thank you. Link to comment https://forums.phpfreaks.com/topic/203599-cloaking-affiliate-links/#findComment-1066703 Share on other sites More sharing options...
lostnucleus Posted June 2, 2010 Share Posted June 2, 2010 by php I mean programatic (automated) , you will need to create a table (url) in database with columns public url , and real url , every public url will have real url assosicated to it ( 1 to 1 relationship) , here real url = your affilate url which you want to hide, you will show public url e.g http://yoursite.com/magic.php?public_url = 12345 when user click on this url , you will do select real_url from url where public_url = 12345 , , now store the real_url , in $real_url return <html> <head> <title>My site name</title> <meta name="description" value="som discription"> <meta nam="keywords" value="apple,oranges"> </head> <frameset rows="100%" border="0"> <frame noresize="noresize" src="<?php echo $real_url ?>"> // <===== <noframes> <body>Sorry your browser does not support frames</body> </noframes> </frameset> </html> Link to comment https://forums.phpfreaks.com/topic/203599-cloaking-affiliate-links/#findComment-1066708 Share on other sites More sharing options...
light87 Posted June 2, 2010 Author Share Posted June 2, 2010 This will not work, since my Website uses the "Strict" DTD (Document Type Declaration). I found out that if you are using Strict for the DTD, then frames or iframes are not allowed. The reference for this is: See "Head First HTML with CSS & HTML" by O'Reilly Books, page 642 "The frameset DOCTYPE's are considered to be transitional, so you can't have frames and be strict." There has to be another way. Thank you. Link to comment https://forums.phpfreaks.com/topic/203599-cloaking-affiliate-links/#findComment-1066888 Share on other sites More sharing options...
jd307 Posted June 3, 2010 Share Posted June 3, 2010 I believe for Strict DOCTYPE's you can use OBJECT, e.g.: <object data="URLhere" type="text/html" .... ></object> This should validate fine. Link to comment https://forums.phpfreaks.com/topic/203599-cloaking-affiliate-links/#findComment-1066980 Share on other sites More sharing options...
lostnucleus Posted June 3, 2010 Share Posted June 3, 2010 dude you are still not getting the point it got nothing to do with DOCTYPE , well I can make a php script to do exactly what you want here for 50 bucks. Link to comment https://forums.phpfreaks.com/topic/203599-cloaking-affiliate-links/#findComment-1066992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.