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

  • SEARCH
  • Home
  • 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 509k
  • Answers 509k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer A bit tenuous, but there is a subtle difference. There… May 16, 2026 at 4:33 pm
  • Editorial Team
    Editorial Team added an answer put your buttons in a scrollview, that is exactly how… May 16, 2026 at 4:33 pm
  • Editorial Team
    Editorial Team added an answer If you are running the Ant script in Eclipse Right… May 16, 2026 at 4:33 pm

Trending Tags

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

Top Members

Related Questions

I was reading about data driven testing using mbunit from this article. http://blog.benhall.me.uk/2007/04/mbunit-datafixture-data-driven-unit.html I
Recently I ran across a blog article about using PHP scripts to redirect affiliate
I read this good article about Routed Events, and I understood why we need
I read this article Managing Hierarchical Data in MySQL At the end of this
After reading an interesting article about unit testing behavior instead of state, I came
I've used the code in this article before to create a custom validator to
I did a lot of searching and also read the PHP $_SERVER docs .
I've created a form that is made up of 2 input fields and a
This is a newbie question to AJAX experts: In case an unauthenticated user tries
Why does the following segfault, and how can I prevent it? <?php $str =

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.