Forum Moderators: open
I know they could copy them one by one, but if there is a way I can hide them in my source code to at least make it more time consuming for them to rip me off, I'd like to do it.
Any way to do it in simple HTML? Or would I have to go to CSS or XHTML or XML?
Thanks!
As tangor suggests you could use a server-side script to manage your links. EG:
<a href="gotopage.php?id=8274">Goto another site</a>
<a href="gotopage.php?id=8274">Goto another site</a>
Just to add... Slight caveat... This approach does kinda break a few (useful) things in the browser. The context (right mouse) menu options to "Copy Link Location", "Send Link...", "Bookmark This Link..." etc. (Firefox) might not work anymore and some (suspicious) users may not like the fact that the true destination of the link is obfuscated in this way.
HTML Document:
<script type="text/javascript">document.write(MakeLink(8274));</script> JavaScript Document:
function MakeLink(LinkID) {
if (LinkID == 8274)
return "http://example.com";
}
else if (LinkID == 8275) {
return "http://nowhere.com";
}
else {
throw "Function MakeLink; unable to return valid link, as argument LinkID was undefined.";
return "/Fake-Error404";
}
}
Unfortunately using JavaScript for making links is also kind of shady. It's suspicious and doesn't work well in non-JavaScript browers. However, it will make it difficult for someone to just copy the links, and like @penders said it will appear to the browser as a normal link, so those features of the browser will still work.
Oh and just a note: If you're going to use the 'aplication/xhtml+xml' mimetype make sure to use a CDATA tag in the <script> area.