Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 932851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:44:07+00:00 2026-05-15T20:44:07+00:00

This article about php form security: http://nedbatchelder.com/text/stopbots.html … mentions a spinner as: The spinner

  • 0

This article about php form security:

http://nedbatchelder.com/text/stopbots.html

… mentions a “spinner” as:

The spinner is a hidden field used for
a few things: it hashes together a
number of values that prevent
tampering and replays, and is used to
obscure field names. The spinner is an
MD5 hash of:

* The timestamp,
* The client's IP address,
* The entry id of the blog entry being commented on, and
* A secret.

The field names on the form are all
randomized. They are hashes of the
real field name, the spinner, and a
secret. The spinner gets a fixed field
name, but all other fields on the
form, including the submission
buttons, use hashed field names.

Does anyone have a code sample of how to implement this on a php page containing a form and the associated php form submission script?

I don’t want to use AJAX, just PHP.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:44:08+00:00Added an answer on May 15, 2026 at 8:44 pm

    You could implement the following:

      On Page Submit:
      <?php
        $spinnerKey = 'spin';
        $spinner = $_POST[$spinnerKey];
        $values = array();
    
        foreach ($_POST as $key=>$value)
        {
          if ($key !== $spinnerKey)
          {
            $values[deHash($key, $spinner)] = $value;
          }
        }
    ?>
    
    A 'deHash' example:
    <?php
    
        # You have to define deHash based on your hash but it 
        # would look something like this:
        var $_rainbowTable = array();
        var $_expectedKeys = array();
    
        function deHash($hashedkey, $spinner)
        {
            $rt = $this->getRainbowTable($spinner);
    
            return isset($rt[$hashedKey])
              ? $rt[$hashedKey])
              : NULL;
        }
    
        function getRainbowTable($spinner)
        { 
            if (count($this->_rainbowTable) > 0)
                return $this->_rainbowTable;
    
            foreach ($this->_expectedKeys as $key)
            {
                $this->_rainbowTable[hash($key, $spinner)] == $key;
            }
    
            return $this->_rainbowTable;
        }
      ?>
    

    Ultimately though I don’t see how this stops bots submitting your page – it just stops people’s “email/user/pass” remember browser plugin from working.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 481k
  • Answers 481k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Instead of having to escape every / in URL regexes… May 16, 2026 at 6:28 am
  • Editorial Team
    Editorial Team added an answer GET and POST are two different types of HTTP requests.… May 16, 2026 at 6:28 am
  • Editorial Team
    Editorial Team added an answer None of the above. Keep the data normalized and create… May 16, 2026 at 6:28 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.