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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.