Hi,

I recently got to know that by encoding IP addresses and adding a timeStamp in the html code of the web page will allow us to detect if the code is copied and even catch who copied it. But i'm still unable to find out how can it be done ??

please can any one help me with this... :)

Dani AI

Generated

A pragmatic distinction is needed up front: preventing casual copying is different from producing a verifiable audit trail. As @LastMitch noted, a determined copier cannot be fully stopped. The most useful approach combines (a) quietly creating server-side evidence that links a specific page view to a retrievable token and (b) routine evidence‑collection and legal/hosting follow‑up when a copy is discovered. This complements third‑party detection suggestions from and the deterrence ideas from and , but focuses on forensics rather than obstruction.

A simple, repeatable workflow: generate an opaque, per‑request token on the server and include it only in an asset URL (image, CSS or JS) delivered with the page. Record token → timestamp → headers (IP, user agent, referer) in a log or database. If a copied page is found, extract the token from that page’s source and look it up in the logs to get the captured request metadata. Example (illustrative):

<?php
$token = bin2hex(random_bytes(16));
$ip = $_SERVER['REMOTE_ADDR'] ?? '';
$ua = $_SERVER['HTTP_USER_AGENT'] ?? '';
file_put_contents('/var/log/asset_tokens.log', "$token\t$ip\t$ua\t".time()."\n", FILE_APPEND);
header('Content-Type: image/gif');
readfile('/path/to/pixel.gif');
exit;
?>

Important caveats and troubleshooting: a token only ties the copied source to the network endpoint that requested the traced asset — NATs, proxies, CDNs and Tor can obscure the human behind an IP. If a token lookup fails, check archived copies (Wayback, cached results), raw HTTP headers, asset filenames, and WHOIS/hosting records. Preserve raw HTML, full response headers and screenshots immediately; contact the host/registrar with timestamps and logs for takedown or log retrieval. Finally, consider privacy and legal implications of logging and publishing request data (consult counsel if needed): forensic value is real, but it is not the same as proof of who physically copied the site.

Recommended Answers

All 9 Replies

Member Avatar for Member #949455

I recently got to know that by encoding IP addresses and adding a timeStamp in the html code of the web page will allow us to detect if the code is copied and even catch who copied it. But i'm still unable to find out how can it be done ??

Are you asking for an opinion or a code?

Adding timestamp is more PHP or you can used javascript.

But this question you ask has nothing to do with HTML & CSS at all?

My personal opinion it doesn't really matter because you can't prevent anyone from doing that.

@LastMitch

Are you asking for an opinion or a code?

i'm asking for an opinion, a way to solve this problem.

My personal opinion it doesn't really matter because you can't prevent anyone from doing that.

Yes we can't prevent that, but can we detect that its being copied by someone and whether we can track who copied it.

hope you can help me :)

Member Avatar for Member #949455

Yes we can't prevent that, but can we detect that its being copied by someone and whether we can track who copied it.

That might have to do with javascript. You can track the code if someone download it by using javascript but for php you can't. But again, it's really hard to prevent it.

Did you try copyscape.com ?

They will tell you who copied your content and link. I would suggest try using copyspcape as they are proven and work better than our custom code.

As LastMitch said..you can't stop content copying but you can see who copied and ask them to scrap them off from their website.

thank you ptduran & Lastmitch for the info :)

Phishers attempt to emulate the look and feel of your web site as good as they
can. Typically, the HTML code and images from your site are just copied. As a
result, the phisher will have to visit the authentic site before setting up the fake
site. Encoding the IP address and a time stamp as part of your HTML code will
likely allow you to figure out when the code was copied from your site, and who
copied it. There are a numerous ways to accomplish this. Adding spaces
between HTML tags, including extra GET parameters, or even watermarking
images.

this is what i recently got to know. sorry for not posting this at the first place. so can you ellaborate this one, i mean i'm clueless how to accomplish this by above mentioned methods...

Basically what it is saying is if you take the visitor's IP and encode it, hide it in your HTML code along with the timestamp that you visited should you ever come across a page which has copied your code you can look at their code and asusming the didn't remove the encoded IP Address than you'll have the IP of the person who copied your code and the date they did so. It won't prevent someone from stealing your code and it won't tell you if someone has stolen your code. But if you come across your stolen code on another website it may give you an idea of who stole it.

There is another way of making your code too difficult to read by obfuscating your code(instead of having line by line code. it is all mashed up in chuncks). That way you can make code stealers go away once they look at your code. Although, they can still use tools to get the code easy to understand. Or it might be a good option to disable a right click action when they try clicking right click -> view source.

At the end of the day, the web is massive and you're trying to prevent your code from a wide variety of people, it is hard.

Try suggestions above and then try obfuscating your html source with ioncube.It is free to download. This may not help you 100%, but parsing scripts will probably have to be rewrite before they can grab your page. Most copy cats are from parsed data using a parser.

If your html codes are obfuscated, then the parser will not be able to find the html tags of page.

ptduran, the link you provided is helpful... :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.