Recently there seems to be an epidemic of serial refunders. There are legitimate reasons for someone to request a refund and those are completely acceptable. As a matter of fact we can use those refund requests as opportunities to create better products however there are also times when the refund request is almost immediate and you know there is no way they were able to go through your 100 page ebook in 13 seconds or the refund requests stating that they did not receive the product or even worse, they file a dispute claiming fraudelent charge”.

We want to provide the best product and customer experience we can while at the same time cutting down the obvious product theft that goes on with digital products.

Most people who are casual internet users probably do not realize that all of their information can be collected and stored. As a matter of fact, you can log in to your hosting account (Host Gator) and get detailed information about each visitor like what page they came from, what pages they visited on your site, how long they stayed on each page, etc.. but the serial refunder usually feel like they are anonymous.

They order your product and then immediately claim a refund.

What we want to do is show them a little of the information that we’ve collected and stored about their transaction so they won’t feel so anonymous. They may think twice about claiming they never received the product when you show them you’ve logged their access to your download page. They may think twice about claiming fradulent card use when you display and log their IP address along with their ISP information complete with a timestamp.

You can copy and paste the following code into your download page which will display their details to them on the page and write some basic information to a log file. There are a few more instruction below this section which you will need to fully utilize but here’s the basic code.

$hostaddress = gethostbyaddr($ip);
$browser = $_SERVER['HTTP_USER_AGENT'];
$referred = $_SERVER['HTTP_REFERER'];
$time = strftime(‘%c’);

$filename = “product1.txt“;
$handle = fopen($filename, “a”);
fwrite($handle, $time . “\n”);
fwrite($handle, $hostaddress . “\n”);
fwrite($handle, $_SERVER['HTTP_REFERER'] . “\n\n”);

print “<strong>The Following Information Has Been Logged:</strong><br />\n”;
print “<strong>Time</strong>: $time<br />\n”;
print “<strong>Your IP</strong>: $hostaddress<br />\n”;
if ($referred == “”) {
print “<strong>Referring URL</strong>: None“;
else {
print “<strong>Referring URL</strong>: $referred”;

Which would display the following information on the download page

$hostaddress = gethostbyaddr($ip);
$browser = $_SERVER['HTTP_USER_AGENT'];
$referred = $_SERVER['HTTP_REFERER'];
$time = strftime(‘%c’);

print “The Following Information Has Been Logged:
print “Time: $time
print “Your IP: $hostaddress
if ($referred == “”) {
print “Referring URL: None”;
else {
print “Referring URL: $referred”;

Change the line
$filename = “product1.txt”;


$filename = “product_name.txt”;

If the product_name.txt file does not exist, this script will create it, if it does, it will open and write to it.

You will want to change this for every product download page so your log files will be exclusive to that product.

Since this is php code, your download page must have the .php extenstion for it to execute the script. If it isn’t, you can either tell your server to treat the .html file as php or you can create a php file and include an iframe on your product download page.

To use an iframe, copy and paste the php code above into a blank text file and save it as product_name.php and upload it to your server, don’t forget to change the .txt file name it will open and write to.

Paste this code into your download page where you want the information to be displayed.

<iframe src=”” frameborder=”0″ width=”550px” height=”120px” scrolling=”no”>

You can change the width and height if you need to.

If you are using DLGuard, which I highly recommend you do if you are in the business of selling digital products, you follow the same steps as above for creating a product_name.php and change the product_name.txt file to write to and then when adding your product into DLGuard or by clicking edit for the product if it’s already been added, paste the iframe code into the “Extra text/HTML code to be added to download page:” field.

To test, just add yourself as a customer and send yourself the download link.

This code will write the log file in the same directory as the script is so you can add the product_name.php files to your root or if you have a lot of products, you can create a sub-folder named “logged” or whatever you like. Just be sure to change the url in the iframe so it knows where to access the php file.

In the code above, you will see the lines that start with “print”, you can change the text to something else if you choose or remove the tags if you like.

This certainly won’t be 100% effective in stopping product theft but it may help keep it to a minimum and it will definitely provide you with some ammo should you need to prove that the refunder did indeed receive their product or make the purchase themselves and that the transaction was not fradulent card use when you are able to respond with both their ip and isp information.

Should you need to search your product log, the referrer, when using DLGuard, will show the receipt number in the referred from line in the log so you can do a quick search for the receipt number to locate the refunders information in your log file.

One other thing this script is handy for and that’s the ability to get a heads up when your products download link is being shared. This isn’t an issue when using DLGuard but otherwise if people are able to directly access your download page you can see in the logs where people are coming from. Obviously, if you start to see people coming from url’s like or accessing your download page directly from google searches then you know you have a problem and need to take action to stop them… like installing DLGuard!

There are some other things we can do by passing other variables through and displaying and/or logging those also but I’ll get into that in another post. I think this is a good start in protecting your downloads and putting the brakes on some of these “anonymous” serial refund offenders.

Til next time,


Additional Articles From "Technical"



Thanks, Gail, great post! I got a little confused around the ‘how to count the cloaked links’ section but I think that was more due to the time (3am) than anything else. I have tried your methods again this morning though and they work perfectly.

I’m using it on an unindexed landing page, driving traffic via PPC, and promoting a clickbank product. So far so good…


Glad you were able to get it going! Your problem with understanding probably had less to do with it being 3am when you were reading and more to do with it being 3am when I wrote it. ;)


Hi Gail,

I tried your cloak link for clickbank, and it worked perfectly on the first time. the same cloak link can be used for commission junction as well?. I looked at your cloak link generator, not sure I understood it well, to give it a try.
thanks for your help Gail.

Warm regrds


Hi Charles,

Glad you were able to use the clickbank code easily. I don’t use CJ much and haven’t tried to see if I could cloak the links. For the misc items I do promote, I use my own url shrinker. You can see it at , you are free to use that one if you like or you can install the script and use on your own site. You can download it at , I also put a link to it in the freebies section. It’s easy to install and the readme file is included. If you have any problems with it, just let me know. On a side note, I think it would not be difficult to do Ebay links and I’ll look at that sometime soon.

Take care,


Hi Gail,

Thank you so much for the reply. the url shrinker seems attractive. No Gail I did not use it yet, though just tested it. Just saw your reply, thought I will say thanks. will catch up with you once I try it out. Thanks again Gail.

Warm Regards


hi nice post pretty useful I got this to work, although it would be nice to know how to also include .html extension on the end instead of just I’m sure this can be all done in .htaccess file just not sure I’m a little bit of a green horn lol!


Hi Sheldon,

It’s no problem to add the .html to the end.

RewriteRule ^(.*)

RewriteRule ^(.*)\.html

Then your link would look like

This works with clickbank as well. And you can change the html to any file extension you want. It is basically just ignored anyway.



thanks for useful tips you let me to know more about .htaccess.
how i can indexing my newly created sites using .htaccess in search engines like google?

thanks alot for article.


Whoa… this site is pretty awesome :) your layout is really well designed, and your blogs are (judging from what i’ve read) very interesting. heehee… consider yourself favorited. :-P


Hello, I enjoy reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wishing you the better of luck for all your blogging efforts.

Flippa Chick

Excellent post! I’ve switched over one of my dynamic websites to a static .html website and was looking for a more efficient way to cloak my Amazon links since I couldn’t use the features of plugins.

Thanks for sharing! :)


Amazon Links idea great. I’m going to try it with my Amazon affiliate sites. thank you.

Share Your Thoughts