Jump to content

Blocking spam


9999

Recommended Posts

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;
}

Link to comment
https://forums.phpfreaks.com/topic/91782-blocking-spam/
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.