45 users online (1 members and 44 guests)  


  Results 1 to 2 of 2

Related

  1. Another AdSense hidden benefit    Forum: Google Adsense
    Replies: 1
  2. convert a perl variable to javascript variable    Forum: Javascript Forum
    Replies: 0
  3. td { overflow: hidden; } ?    Forum: CSS Forum
    Replies: 10
  4. Replies: 5
  5. Replies: 10
  1. #1
    ronnirowland's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2006
    Posts
    5

    Hidden Variable to Stop Spam from Forms - PHP

    I've read that I can add a hidden variable to a form to stop spammers from generating spam from the form. But I can't seem to find the line of code anywhere to achieve this. I'm using PHP to send the form data via email.

    Thanks for your help!
    Ronni

  2. #2
    zopheus's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2006
    Posts
    1

    Re: Hidden Variable to Stop Spam from Forms - PHP

    Quote Originally Posted by ronnirowland
    I've read that I can add a hidden variable to a form to stop spammers from generating spam from the form. But I can't seem to find the line of code anywhere to achieve this. I'm using PHP to send the form data via email.

    Thanks for your help!
    Ronni

    It is simple:
    <input type="hidden" name="secret_word" value="top_secret">
    Now when you process your form you can check for the value of the hidden field to make sure you are getting data from your form and not someone else. To be even more secure you could use a rotating code as the value that is generated from a database field or random numbers. All you need to do is be able to predict what it is.



Tags for this Thread