greg Posted August 25, 2010 Share Posted August 25, 2010 Hi there, I'm running a php based website and I'm getting a lot of remotely posts to the forms. Is any way to prevent this using php or .htacces. Any tip o a site from where I should start? Thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/211739-how-can-i-block-remote-post-to-a-form/ Share on other sites More sharing options...
fortnox007 Posted August 26, 2010 Share Posted August 26, 2010 If you mean robots that stumble upon your site and post, Captcha is what your looking for. If the violaters arent numerous you could try to block there ip's with .htaccess (google for: Order deny + .htaccess). But captcha nicer i think Quote Link to comment https://forums.phpfreaks.com/topic/211739-how-can-i-block-remote-post-to-a-form/#findComment-1103796 Share on other sites More sharing options...
greg Posted August 26, 2010 Author Share Posted August 26, 2010 No exactly robots but some malicious intruders. Blocking ip is not a common sense because they use proxies. Some one please elaborate on this. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/211739-how-can-i-block-remote-post-to-a-form/#findComment-1103800 Share on other sites More sharing options...
trq Posted August 26, 2010 Share Posted August 26, 2010 Check the $_SERVER['HTTP_REFERER'] is your site. Quote Link to comment https://forums.phpfreaks.com/topic/211739-how-can-i-block-remote-post-to-a-form/#findComment-1103832 Share on other sites More sharing options...
greg Posted August 26, 2010 Author Share Posted August 26, 2010 How I do that when the referring pages are dynamic? Quote Link to comment https://forums.phpfreaks.com/topic/211739-how-can-i-block-remote-post-to-a-form/#findComment-1103970 Share on other sites More sharing options...
trq Posted August 26, 2010 Share Posted August 26, 2010 How I do that when the referring pages are dynamic? You are surely aware of the valid address of the form posting to your processing script? Quote Link to comment https://forums.phpfreaks.com/topic/211739-how-can-i-block-remote-post-to-a-form/#findComment-1103971 Share on other sites More sharing options...
shlumph Posted August 26, 2010 Share Posted August 26, 2010 You could even just check the referring domain name Quote Link to comment https://forums.phpfreaks.com/topic/211739-how-can-i-block-remote-post-to-a-form/#findComment-1103976 Share on other sites More sharing options...
AbraCadaver Posted August 26, 2010 Share Posted August 26, 2010 Create a unique token on your form page, stick it in the session, add it as a hidden input to your form. When submitted check that the hidden form field token matches the session token. There are plenty of examples out there. Quote Link to comment https://forums.phpfreaks.com/topic/211739-how-can-i-block-remote-post-to-a-form/#findComment-1103997 Share on other sites More sharing options...
greg Posted August 26, 2010 Author Share Posted August 26, 2010 Thank you!!!!! Like I said, jkaiosdaxcss Quote Link to comment https://forums.phpfreaks.com/topic/211739-how-can-i-block-remote-post-to-a-form/#findComment-1104154 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.