View Single Post
Old 08-30-2006, 01:46 PM  
borked
Totally Borked
 
borked's Avatar
 
Industry Role:
Join Date: Feb 2005
Posts: 6,284
OK, this js shit works - no dbase no nothing, just javascript. Call it from an iframe or whatever you want...not sure, but prolly able to call it as a header to all images from htaccess....either way the code works and is simple


Code:
<script language=javascript>
//Beginning of "test.js" file
var accepted_domains=new Array("yourdomain.com","www.yourdomain.com")

var domaincheck=document.location.href //retrieve the current URL of user browser
var accepted_ok=false //set acess to false by default

if (domaincheck.indexOf("http")!=-1){ //if this is a http request
for (r=0;r<accepted_domains.length;r++){
if (domaincheck.indexOf(accepted_domains[r])!=-1){ //if a match is found
accepted_ok=true //set access to true, and break out of loop
break
}
}
}
else
accepted_ok=true

if (!accepted_ok){
alert("Fuck off linking to my images!!")
history.back(-1)
}

</script>
<img src="image123.jpg">
__________________

For coding work - hit me up on andy // borkedcoder // com
(consider figuring out the email as test #1)



All models are wrong, but some are useful. George E.P. Box. p202
borked is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote