Jump to content


Photo

um lil question


  • This topic is locked This topic is locked
20 replies to this topic

#1 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 15 July 2006 - 10:17 AM

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

#2 GingerRobot

GingerRobot
  • Staff Alumni
  • Advanced Member
  • 4,086 posts
  • LocationUK

Posted 15 July 2006 - 10:24 AM

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.

#3 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 15 July 2006 - 11:04 AM

You can do if you want to, by putting this code at the top of the page:

<?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();
}
?>

OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application

#4 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 15 July 2006 - 06:31 PM

why is there an exit


#5 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 15 July 2006 - 06:34 PM

So the rest of the page doesn't load.

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#6 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 15 July 2006 - 06:34 PM

oh ok thanks

#7 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 15 July 2006 - 06:41 PM

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


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.



#8 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 15 July 2006 - 06:56 PM

And don't people with dialup get new IP addresses all the time?

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#9 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 15 July 2006 - 07:17 PM

I think that they generally will each time they Dial-Up, and even during the session for certain ISPs like AOL.
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#10 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 15 July 2006 - 07:32 PM

can i ban isps ? cuz then i could just ban all the dial up isps and get over that small glitch

#11 Gast

Gast
  • Members
  • PipPipPip
  • Advanced Member
  • 131 posts
  • LocationSouth East England

Posted 16 July 2006 - 01:30 PM

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.
OS and Internet Specs:
Windows XP (with SP2), 1680x1050, PHP 4, MySQL 3, Internet Explorer 6 &7 /FireFox 2.0/Opera 9.2

Tutorials:
Simple Introduction to AJAX and XMLHttpRequest
Creating Live Data with AJAX Making a Google Suggest like application

#12 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 16 July 2006 - 04:43 PM

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?
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#13 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 16 July 2006 - 07:33 PM

yea i know but it would keep the speed up on my site cuz i wouldnt have a bunch of slow ppl

#14 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 16 July 2006 - 07:36 PM

Whaaaaat does that mean??
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#15 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 16 July 2006 - 07:37 PM

yea i know but it would keep the speed up on my site cuz i wouldnt have a bunch of slow ppl


Wrong. The speed at which http requests are passed across the internet has nothing to do with the speed of your server. 
Legend has it that reading the manual never killed anyone.
My site

#16 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 16 July 2006 - 07:40 PM

ok well i still want to know how to do it :)

#17 ShogunWarrior

ShogunWarrior
  • Members
  • PipPipPip
  • Advanced Member
  • 528 posts
  • LocationIreland

Posted 16 July 2006 - 07:43 PM

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.
<a href="http://www.daviddora...nmedia.com/">My New Site/Blog</a> | <a href="http://www.daviddora...m/check/">Check your page for broken links/images/scripts</a>

Zend Certified Engineer
Follow me on Twitter: http://twitter.com/davidd

#18 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 16 July 2006 - 09:09 PM

thats not wat i mean i want to ban isps like dial up isps is there a way
to ban isps?

#19 pixy

pixy
  • Members
  • PipPipPip
  • Advanced Member
  • 295 posts

Posted 16 July 2006 - 09:20 PM

If you're not having people doing things to your site, then you should have no reason to ban them.

This is a .44 Caliber Loveletter straight through my heart.

Tabulas + Threadless + Hire Me!


#20 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 16 July 2006 - 09:54 PM

i didnt ask for a reason just for ansers ;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users