9999 Posted February 18, 2008 Share Posted February 18, 2008 My question is similiar to this post: Hi all, I need help with my php forms. I read an article that you can prevent form spam by using a hidden field, and requiring it to be blank for the form to be processed. I have no problems with setting the required html / css up, but have no idea where to start with the php code required to stop the form from being sent if left blank. I have very limited knowledge of php, please bare this in mind. Anyone point me in the right direction or explain the code to me please? I've tried a search on the forum but couldn't find anything, and sites that have mentioned the method never explain what you need to do with the php! Thanks in advance...! I placed this in the form: <input id="human" type="text" /> I used this in the CSS to hide the field, this works: #human { visibility:hidden; display:none; } My question is, what is the correct php code? I tried this and it didn't work: If (isset($_POST['human'])) { die; } I also tried this but it kills everything right of the bat without even displaying the form If (!isset($_POST['human'])) { die; } Quote Link to comment Share on other sites More sharing options...
schilly Posted February 18, 2008 Share Posted February 18, 2008 First read up on how PHP Forms work. Lots of tutorials around. It will look something like: If ($_POST['submit_button_name']) { If($_POST['human'] == "") //process form Else //spam die(); } Quote Link to comment Share on other sites More sharing options...
redarrow Posted February 18, 2008 Share Posted February 18, 2008 read this please http://www.encaps.net/software/php-captcha/ 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.