Jump to content

Archived

This topic is now archived and is closed to further replies.

BillyBoB

um lil question

Recommended Posts

is there an site that i can goto where i can get
info on how to block ips in php script the blocked ips will be in a database
plz tell me thanks

Share this post


Link to post
Share on other sites
Ok, well the short answer is dont. IPs are unreliable and many people's IP address change very regularly. Also, some ISPs force all their clients through a proxy, making all their IPs the same. If you were to ban one person from that ISP, all would be banned.

Share this post


Link to post
Share on other sites
You can do if you want to, by putting this code at the top of the page:

[code]<?php
// Array of all IPs blocked, you can get this from a database if you wish
$ips = array("255.255.255.255", "123.45.678.90", "11.111.11.111");

if(in_array($_SERVER['REMOTE_ADDR'], $ips)) {
print("You have been banned from this website and are unable to view it.");
exit();
}
?>[/code]

Share this post


Link to post
Share on other sites
[quote author=BillyBoB link=topic=100657.msg397635#msg397635 date=1152958637]
is there an site that i can goto where i can get
info on how to block ips in php script the blocked ips will be in a database
plz tell me thanks
[/quote]

Perhaps the best queston would be, why do you want to ban them?

In regards to the post that talks about how an ISP might change their clients IPs regularly, then you should ask yourself. What are these people doing that makes you want to ban them? 

If they are users on your website. You could block their login username.  If they try to sign up again, you can check to see if they are trying to use the same email address.  Sure people can create multiple email addresses, but then you could just limit the email addresses of your users to that of their ISP (yes I know some ISPs can allow up to 10 emails or even more).

Just some thoughts.  Personally I'd ban the IP.  Another thing I have thought about is banning the ISP.  You do a reverse lookup to see what domain they are from and ban that.  If there are multiple users from the ISP, then you could do a ignore type thing to ignore those who are good.  Then after a while if the trouble seems to calm down you could lift the ISP ban.
This is what we've done on MUDs that I've helped maintain etc.  Though its a bit of a pain if alot of users are from a particular banned ISP.

Share this post


Link to post
Share on other sites
And don't people with dialup get new IP addresses all the time?

Share this post


Link to post
Share on other sites
I think that they generally will each time they Dial-Up, and even during the session for certain ISPs like AOL.

Share this post


Link to post
Share on other sites
can i ban isps ? cuz then i could just ban all the dial up isps and get over that small glitch

Share this post


Link to post
Share on other sites
Like GingerRobot said above, if you ban an ISP you cna ban thousands of people who havent even been to your website. If they visit they could then have been banned and have not done anything.

Share this post


Link to post
Share on other sites
Why do you need to band an ip address, if your site is properly coded with the correct valadation code then there should'nt be a problam.

what problam have you got?

Share this post


Link to post
Share on other sites
yea i know but it would keep the speed up on my site cuz i wouldnt have a bunch of slow ppl

Share this post


Link to post
Share on other sites
[quote author=BillyBoB link=topic=100657.msg398288#msg398288 date=1153078419]
yea i know but it would keep the speed up on my site cuz i wouldnt have a bunch of slow ppl
[/quote]

Wrong. The speed at which http requests are passed across the internet has nothing to do with the speed of your server. 

Share this post


Link to post
Share on other sites
Well there isn't really a way to know if they're on Dial-Up I think.
And anyway Dial-Up people will use LESS bandwidth than broaband users.

Share this post


Link to post
Share on other sites
thats not wat i mean i want to ban isps like dial up isps is there a way
to ban isps?

Share this post


Link to post
Share on other sites
If you're not having people doing things to your site, then you should have no reason to ban them.

Share this post


Link to post
Share on other sites
This thread is no longer serving any useful purpose.

I suggest using Google to look for the information you need.  When you have some code written, if you can't get it to work then open a new thread.  Meantime, look at what Gast posted since that will set you on the way.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.