1
eikke
Block by referer
  • 2004/1/19 12:32

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


Ive got a Xoops-powered website, and I'd need a feature: if people come from a certain URL (well, some URLs), and they come to my site (so their referer is one of those URLs), they should get a blank screen or whatever, and a cookie should be set, so I can track them (when they try to come back, even originating from another site, they still should get a blank screen). So if a visitor comes to my site, originating from one of those URLs, they should never be able to visit my site (well, unless they clear their cookies).
I know how to code PHP, thats no problem, but I have no idea *where* to modify some things... I could do it in /index.php, but then a user would be allowed to visit /modules/news/index.php etc... Its a bit stupid to edit every possible .php file in my site

Any help would be very appreciated!

Thanks, Ikke

2
Herko
Re: Block by referer
  • 2004/1/19 12:37

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


Try adding it in header.php, that file is included in every other page.

Herko

3
Mithrandir
Re: Block by referer

Or rather - make the referrer check script in another file, which you then include in the root/header.php - easier to upgrade that way, when it's just a matter of including one extra file in header.php.

4
DonXoop
Re: Block by referer

include() is a cleaner way indeed.

You can also add the IP to the ban list and activate it. Only effective if they are unlucky enough to have a long term IP like many cable modems.

But the game of chasing bad users gets old very fast. You eventually tighten other things up.

Login

Who's Online

580 user(s) are online (450 user(s) are browsing Support Forums)


Members: 0


Guests: 580


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits