Action, protest, campaigns, demos and issues magazine features, photos, articles, stories photos of London, New York, Wales, England and photography features music, parties, clubs, events, records, releases drug information, harm reduction, no-nonsense guide punch a celebrity football, features, issues, cardiff city games, useless games and diversions technical info, web authoring, reviews and features site news, updates and urban75 blog urban75 community news and events urban75 bulletin boards join the chatroom search urban75 back to urban75 homepage
London features, photos, history, articles New York features, photos, history, articles Brixton features, photos, history, articles panoramas, 360 degree vistas, London, New York, Wales, England Offline London club night festival reports, photos, features and articles urban75 sitemap and page listing about us, info, FAQs, copyright join our mailing list for updates and news contact urban75
Protect your site's content from opportunistic thieves and make it harder to steal from your site
The lowdown

PART TWO: Make it harder for people to nick your lovingly crafted code


» Index
» Introduction
» Protecting code
» Protecting text
» Protect images
» Multimedia
» More info

« tech homepage


urban75 web project Protecting your site's content
Protecting your HTML code
By Mike Slocombe for Internet Magazine, Feb 2004


1. No right click
Some authors use JavaScript to disable the right mouse click in a vain attempt to stop people looking at their source code.

Not only is it easy to get around this by a variety of methods (like simply saving the page) it usually only succeeds in really annoying visitors.

The highly annoying 'no right click' error message <SCRIPT>function click()
{if (event.button==2)
{alert('Ooops...\nRight click is disabled!');}
}document.onmousedown=click//
-->
</SCRIPT>


Related article: Don't disable right click!


2. Software protection
Several commercial products like HTML Protector claim to prevent visitors from seeing your source code.

The highly annoying 'no right click' error message All they actually do is call up a JavaScript function called 'unescape' which 'encodes' the HTML code into a long string of characters.

Unfortunately, these can easily be converted back to HTML using a similar piece of JavaScript.

See how it's done here: Protect Your Code and Graphics - Or Not or download a free PHP obfuscating HTML encoder


3. Stripping your HTML

stripping out all the spaces in your HTML code Stripping out all the spaces in your HTML code so that your code is in one big long line can make it much harder for people to read.

The good news is that it'll also make your pages faster to download.

The bad news is that editing it afterwards can be a right royal pain!

Download out this freeware program which removes any unnecessary space and new-line characters: HTML Optimizer







urban75 - community - action - mag - photos - tech - music - drugs - punch - football - offline club - brixton - london - new york - useless - boards - help/FAQs - © - design - contact - sitemap - search