Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Want to keep people from certain sites off your web page?

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
benburch Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 07:35 PM
Original message
Want to keep people from certain sites off your web page?
Put this script in the <HEAD> of it;

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var refarray = new Array();
refarray['certainsiteone.com'] =
"http://www.aclu.org/";
refarray['certainsitetwo.com'] =
"http://www.aclu.org";
refarray['certainsitethreeetc.com'] =
"http://www.aclu.org";
for (var i in refarray) {
if (document.referrer.indexOf(i) != -1)
window.location.replace(refarray[i]);
}
//  End -->
</script>

Then at least they cannot get to it from a link on their
site.
 
Printer Friendly | Permalink |  | Top
iconoclastic cat Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 07:45 PM
Response to Original message
1. In this case, the referrer is the ACLU site, correct?
Printer Friendly | Permalink |  | Top
 
wtmusic Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 07:46 PM
Response to Reply #1
3. no he's redirecting them there nt
Printer Friendly | Permalink |  | Top
 
iconoclastic cat Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 07:47 PM
Response to Reply #3
4. Oh, I get it. Thanks!
Printer Friendly | Permalink |  | Top
 
benburch Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 07:49 PM
Response to Reply #3
6. Yes.
The sites are "certainsiteone.com" "certainsitetwo.com" "certainsitetheeetc.com"

There are ways they can still get around it, and they could turn referrers off, but the goal is to annoy certain people!

And you can pick any other site, doesn't need to be aclu.org! :evilgrin:
Printer Friendly | Permalink |  | Top
 
wtmusic Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 07:45 PM
Response to Original message
2. with a couple of qualifiers
Edited on Thu Aug-11-05 07:50 PM by wtmusic
1) easy to spoof the referrer environment variable
2) most people don't send mail from their website but from the SMTP server at their ISP (even if their return address says so)

onedit:
3) if the link gets to you via a proxy server it won't work...

it will work part of the time.
Printer Friendly | Permalink |  | Top
 
benburch Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 07:50 PM
Response to Reply #2
7. Works enough of the time to be a bloody annoyance...
And that was the goal.
Printer Friendly | Permalink |  | Top
 
wtmusic Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 07:57 PM
Response to Reply #7
8. haven't had too much luck with this technique
but your code is slicker than mine...I should give it another shot
Printer Friendly | Permalink |  | Top
 
LTR Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 07:47 PM
Response to Original message
5. Nice code, Ben
I could think of some pretty nasty sites to send 'em to, though.
Printer Friendly | Permalink |  | Top
 
zbdent Donating Member (1000+ posts) Send PM | Profile | Ignore Thu Aug-11-05 08:03 PM
Response to Original message
9. Redirect them to the local recruitment offices
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Thu Apr 18th 2024, 05:41 PM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC