View Full Version : Resrict access to site

02-19-2012, 06:59 PM
Im trying to find a way to stop repeat views of my site, strange I know.

Ive tried a timed ip block but couldnt get that to work so im thinking cookie based.

Ive no idea how to do this so if anyone has any ideas or code I would be grateful.

I have an ex employee that keeps hitting my site but hes using a ip switcher so I cant keep up with blocking him manually, 3000 hits in one day.

I want to allow access to site then when the visitor leaves they wont be allowed back to view again for 36 hours.

Any ideas?

02-19-2012, 08:47 PM
What about potential real customers, who visit in the morning, go to lunch and want to visit again same day?

02-19-2012, 09:02 PM
The site I have will only refresh every 36 hours, its for voting on photos from local car club but rival club is messing with votes.

02-19-2012, 09:25 PM
You can use the setcookie() function.

02-20-2012, 09:22 AM
You can use the setcookie() function.

Sure, if the attacker is using one machine that might work but if they're using several machines (which I suspect) then thats absolutely useless (along with my suggestion for looking into the e-tag!).

The only thing you can do here is to implement a anti-spam mechanism like a captcha. No-one will sit there manually entering one captcha after another just to wind you up. There is one on tinypic.com that is flashbased which seems rather good and I don't think its their own (IE I think its one that you can sign up to use). You might want to look into that.

02-20-2012, 12:15 PM
Believe it or not the guy who is is doing this has done that before, he sat there and filled out my captcha forms 126 times, sad sad man.

I have a timed ip block script which i posted on here a while ago but just couldnt get it to work or i was putting it in the wrong place.

I want to log ip address time and date in a text file,
check visitor details when they arrive,
if on file block for 36 hours,
if not on file let into site and log ip/time/date
when they leave and try to return they then go to check log again

Does that make sense?

02-20-2012, 12:38 PM
Believe it or not the guy who is is doing this has done that before, he sat there and filled out my captcha forms 126 times, sad sad man.

So he got bored eventually then :thumbsup:

There isn't really a 100% fool proof way of stopping someone from doing this except to make it time consuming. That way they'll get bored or run out of time.

You could always put into place email validation.. that'll slow him down even more.

02-20-2012, 11:41 PM
it's seems to me like someone try to flood your site with connection...
Is there in the cPanel no option to block the IP address of the attacker?

Or maybe you write a function like IP_filter and put it on the top of your page.
The IP_filter should collect IP address from the visitors and the visiting date with the visiting time and start to count the time and stop the visitor to load the page if xx time is not reached.
Until the time is counting for the visitor they will be redirected to an error page let's say...

So, in a real short time you will get a nice database with IP's of the visitors and this should work...

Or you maybe try to see what options ur have to attack a site... ;-)
Is this your really question...