Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-09-2007, 02:44 PM
Junior Member
 
Join Date: Aug 2007
Posts: 2
Default zend_validate problem, seems to bypass validation attempts

Hi all,

i have a problem with zend validate, it was working, but now it seems to be being bypassed. When i try isValid() on a variable, after specifying validation chain, i get no data returned. The code block is just bypassed, validation doesnt block invalid input, at all!

I am storing my data in the zend_registry, and i can read out the data no problem, so the data itself IS there(user/pass)........heres my validation code.....

Code:
require_once 'Zend/Validate.php';
require_once 'Zend/Validate/NotEmpty.php';
require_once 'Zend/Validate/StringLength.php';


	$validatorchain = new Zend_Validate();
	$validatorchain	-> addValidator(new Zend_Validate_NotEmpty)
			      -> addValidator(new Zend_Validate_StringLength(6, 12));


		//check basic data validation criteria
		if (!$validatorchain->isValid(Zend_Registry::get('username')) || !$validatorchain->isValid(Zend_Registry::get('password'))) {
			
			foreach ($validatorchain->getMessages() as $message) {
				$this->view->usermsg.=$message."\n";
			}

			$this->_forward('index','index');

		}
any help would be much appreciated.....im sure i will be back with many more problems after this!! this is my first zend mvc application.

TIA
SC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:45 AM.