RaythMistwalker Posted March 21, 2010 Share Posted March 21, 2010 I've had an Idea for an anti-spam measure to stop spam accounts from registering if they are bots, Would it be possibly (and if so how would i do this) to make a hidden field that users cannot see but obviously bots will. Hence since bots fill in every field if this field has info in it then the account will not be created and it will alert admin of ip address etc. So how would i make a hidden text field? Quote Link to comment https://forums.phpfreaks.com/topic/196045-anti-spam-measure/ Share on other sites More sharing options...
oni-kun Posted March 21, 2010 Share Posted March 21, 2010 Meh, something simple like this should suffice: <form action=...> .. .. <input type="text" name="name_" value="Name" style="display: none;"/> .. </form> <?php if(isset($_POST['name_'])) { $ip = $_SERVER['REMOTE_ADDR']; $sql=mysql_query('...$ip..'); } ?> You can do what you want with it there, It'll be invisible to the user but appear to the bot, especially since it has 'name' in it. Quote Link to comment https://forums.phpfreaks.com/topic/196045-anti-spam-measure/#findComment-1029741 Share on other sites More sharing options...
jamiet757 Posted March 21, 2010 Share Posted March 21, 2010 That is an alright idea, however I can see some bots still slipping by. Why not just us a captcha, I like recaptcha, it is easy to integrate and I haven't had a bot get past it yet. Quote Link to comment https://forums.phpfreaks.com/topic/196045-anti-spam-measure/#findComment-1029790 Share on other sites More sharing options...
5kyy8lu3 Posted March 21, 2010 Share Posted March 21, 2010 some bots change IP each page hit so you can also store their IP into a session variable on the form page and then compare it to their current IP on the submit page. only take like 1 line of code and can stop alot of bots. every little thing helps Quote Link to comment https://forums.phpfreaks.com/topic/196045-anti-spam-measure/#findComment-1029793 Share on other sites More sharing options...
oni-kun Posted March 21, 2010 Share Posted March 21, 2010 That is an alright idea, however I can see some bots still slipping by. Why not just us a captcha, I like recaptcha, it is easy to integrate and I haven't had a bot get past it yet. Sometimes that is not the case, but upon reviewing his question, maybe he isn't implementing any basic security such as a TURING test. That combined with my aforementioned code should be nicely enough to catch automated bots. some bots change IP each page hit so you can also store their IP into a session variable on the form page and then compare it to their current IP on the submit page. only take like 1 line of code and can stop alot of bots. every little thing helps What is the point of this? Quote Link to comment https://forums.phpfreaks.com/topic/196045-anti-spam-measure/#findComment-1029794 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.