Jump to content

ip ban?


ki

Recommended Posts

ok ive been working on an ip banning script, but its not working so im pissed off, because these people wont stop spamming my site and theyre using the same ip so this is what i got.

[code]
$ipArray = array('217.159.200.187');

if($_SERVER['REMOTE_ADDR'] == $ipArray) {
header("Location: http://www.google.com/");
die();
}[/code]

the array is for others to come
Link to comment
https://forums.phpfreaks.com/topic/32798-ip-ban/
Share on other sites

Authenticate their account prior to allowing them to do anything with your site? Send them a link in an email use a hash in the authenticate link back to your site and test it against what they entered? People use the MD5 hash of the password to do this usually.

Use captcha's to discourage scripting/bots for doing dumb things

Require their posts to be moderated until they post a certain amount?

Temporary ban their IP address block such as: 217.159.200.* ??

[code]
<?php
$ipArray = array('217.159.200.187');

if(in_array($_SERVER['REMOTE_ADDR'], $ipArray)) {
header("Location: http://www.google.com/");
exit();
}
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/32798-ip-ban/#findComment-152716
Share on other sites

Archived

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

×
×
  • Create New...

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.