alexandom Posted June 28, 2007 Share Posted June 28, 2007 I have a simple php code that I received from my hosting that allows me to capture information from people who visit my site. I am now facing a problem with someone overloading my form.txt that is attached to my form.php with thousands of emails and I need to stop them. My hosting tells me that I need to look for an IP ban script. Any advise??????????? Thanks Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted June 28, 2007 Share Posted June 28, 2007 you can create your own fairly simply. there should be many tutorials around the internet. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 28, 2007 Share Posted June 28, 2007 IP banning is pretty unreliable. People can change their IP addresses, then just come right back and start populating your text file again. Are people supposed to be able to write to your text file? If not...set it to read only, then they can't put anything in it. Maybe start storing the info in the text file in a database instead? Quote Link to comment Share on other sites More sharing options...
corbin Posted June 28, 2007 Share Posted June 28, 2007 Chances are, the person is using a script of some form to do it, so a CAPTCHA might stop them (Google it) along with anyone else you might have future issues with. As for the IP thing, the viewer's IP is stored in $_SERVER['REMOTE_ADDR'], so you could do something like: $banned = array('xxx.xxx.xxx.xxx'); if(in_array($_SERVER['REMOTE_ADDR'], $banned)) { echo 'You\'re banned!'; exit; } Edit: fixed the syntax error. Thanks ProjectFear ;p Quote Link to comment Share on other sites More sharing options...
redarrow Posted June 28, 2007 Share Posted June 28, 2007 be clever here dont do it with ip ban do it by email address and a ip cheek via email. Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted June 28, 2007 Share Posted June 28, 2007 except you wouldnt have errors in your code like corbin. lol. that would result in an error because you didnt escape your ' in the echo. lol. Quote Link to comment Share on other sites More sharing options...
corbin Posted June 28, 2007 Share Posted June 28, 2007 Ehhh, I'm allowed to make mistakes too! I originally had "s, but I changed it to 's because I've been trying to get in the habbit of using single quotes when variables aren't involved.... I'm OCD ;p. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.