Allow page access only from pre-listed referrer

i used this trick normally for my rapidleech, it forbid a person to access my rapidleech from copy paste link on browser address,  my rapidleech can only be access by clcking the link on page that i use as referral.

for ex, if i use my web here, blindtext.info, someone would be able to access only by click the link i posted here.

how i do this? simple

copy paste this javascript into your page, insert in on <head> sections of your html or php code. if u use it on rapidleech, insert it into main.php, look for <head> …… <head> section, insert it somewhere between <head> …. </head>

<script language="javascript">
 //specify valid referrals for script to accept
 //if you wish an entire domain to be valid, enter that (ie: "jre-ganteng.net")
 var validreferrals=new Array()
 validreferrals[1]="yourdomain1.com"
 validreferrals[2]="yourdomain2.net"

 var passed=0

 for (r=0;r<validreferrals.length;r++){
 if (document.referrer.indexOf(validreferrals[r])!=-1){
 passed=1
 break
 }
 }

 if (passed==0){
 alert("Access denied! Cuma re-ganteng yang boleh masuk !!!!")
 history.go(-1)
 location.href='http://your-redirect-destination.com'
 }

 //-->
 </script>

this script will cek http referer that access your page, if the referrer isn’t listed, than the visitor will redirect to any destination u want

3 Comments »

  1. avatar comment-top

    Thanks brother..
    Now i can modified my RL with your cekrip….  

    comment-bottom
  2. avatar comment-top

    Work very nice!

    Ia was looking for long time – find just here…

    Thank you!  

    comment-bottom
  3. avatar comment-top

    @ oner, ds please :D
    @ sky, hope my article usefull for you  

    comment-bottom

RSS feed for comments on this post. TrackBack URL

Leave a comment