Login
Connect via Facebook

Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
Forum Threads
Users Online
Guests Online: 1

Members Online: 0

Total Members: 619
Newest Member: Pranav Adithya
Advertising
Donate
If you like our free products please donate us.

Advertising
View Thread
 Print Thread
Referrer Checker
Admin
A security script that checks the URL the surfer came to to arrive to the current page. If its not the specified URL, the surfer is denied access. Use this script if you wish to allow surfers to enter a page only through a predetermined previous page.

Simply insert the below into the <head> section of the target page. Configure the URLs for the script to accept entry for:
Download source  GeSHi: Javascript
  1. <script>
  2. //specify valid referrals for script to accept
  3. //if you wish an entire domain to be valid, enter that (ie: "javascriptkit.com")
  4. var validreferrals=new Array()
  5. validreferrals[0]="http://www.javascriptkit.com/script/cut170.shtml"
  6. validreferrals[1]="http://javascriptkit.com/script/cut170.shtml"
  7.  
  8. var passed=0
  9.  
  10. for (r=0;r<validreferrals.length;r++){
  11. if (document.referrer.indexOf(validreferrals[r])!=-1){
  12. passed=1
  13. break
  14. }
  15. }
  16.  
  17. if (passed==0){
  18. alert("Access to the page denied!")
  19. history.go(-1)
  20. }
  21.  
  22. //-->
  23. </script>
Parsed in 0.006 seconds, using GeSHi 1.0.8.10
 
Jump to Forum: