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 6064023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:14:05+00:00 2026-05-23T09:14:05+00:00

On my bootstrap I don’t have a class, it’s a simple php file: I

  • 0

On my bootstrap I don’t have a class, it’s a simple php file:

I have added there:

$loader = Zend_Loader_Autoloader::getInstance ();
$loader->setFallbackAutoloader ( true );
$loader->suppressNotFoundWarnings ( false );

//resource Loader
$resourceLoader = new Zend_Loader_Autoloader_Resource(array(
                'basePath' => APPLICATION_PATH,
                'namespace' => '',
            ));

$resourceLoader->addResourceType('validate', 'validators/', 'My_Validate_');

$loader->pushAutoloader($resourceLoader);

Then, in application/validators I have:

class My_Validate_Spam extends Zend_Validate_Abstract {

    const SPAM = 'spam';  

    protected $_messageTemplates = array(  
        self::SPAM => "Spammer"  
    );  

    public function isValid($value, $context=null)  
    {  

        $value = (string)$value;  
        $this->_setValue($value);  

        if(is_string($value) and $value == ''){  
            return true;  
        }  

        $this->_error(self::SPAM);  
        return false;  

    }  
}

In my form constructor I have:

$this->addElement(  
                'text',  
                'honeypot',  
                array(  
                    'label' => 'Honeypot',  
                    'required' => false,  
                    'class' => 'honeypot',  
                    'decorators' => array('ViewHelper'),  
                    'validators' => array(  
                        array(  
                            'validator' => 'Spam'  
                        )  
                    )  
                )  
            );  

And finally on my view I have:

<dt><label for="honeypot">Honeypot Test:</label></dt>
<dd><?php echo $this->form->honeypot;?></dd>

Despite all this, I receive my form data, either by filling or not filling that text field.
What am I missing here ?

Thanks a lot in advance.

  • 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-23T09:14:06+00:00Added an answer on May 23, 2026 at 9:14 am

    Thats expected behaviour. $honeypot is a form-element. Now, let’s say you have a form $hp_form where $honeypot is one of the elements assigned.

    Now, in your controller simply use something like:

     if ($hp_form->isValid($this->getRequest()->getPost())) {
         // do something meaningful with your data here
     } 
    

    Probably you also want to check, if you display the form for the first time or if the user submitted the form:

     if ($this->getRequest()->isPost() && 
            false !== $this->getRequest()->getPost('submit_button', false)) {
         if ($hp_form->isValid($this->getRequest()->getPost())) {
             // do something meaningful with your data here
         } 
    }
    

    …assuming that your submit button has the id ‘submit_button’.

    Hope this helps

    Bye,
    Christian

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

Sidebar

Related Questions

In my bootstrap.php I have the following: if($_SERVER['SERVER_NAME'] == 'localhost') Kohana::$environment = 'development'; else
I have, I believe, a simple problem, but I don't know how to solve
So far i have been using Bootstrap.php to load my application.ini config into Zend_Registry
Is it a good practice to bootstrap your PHP application. I found two ways
Here is my route definition in the bootstrap file: $router = $this->frontController->getRouter(); $route =
What class(FrontController , Bootstrap, Dispacher....) sets up the default structure path in ZF?
I'm writing my first PHP app. Everyone talks about having a bootstrap.php to initialize
If I want to use global $user in a php file outside the drupal
Twitter Bootstrap is a cool stylesheet toolkit by Twitter based on LESS. I don't
I've been looking at Twitter's Bootstrap framework and I'm really impressed. However, I don't

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.