Ive got the following code to add a section into a cms but when i run it it comes back with the error Fatal error: Call to undefined method Validator::validateTextOnlyNoSpaces().
Code: Select all
// ADD SECTION ////////////////////////////////////////////////////////////////////
if ($HTTP_GET_VARS['action'] == 'add'){
[b]$validator->validateTextOnlyNoSpaces($HTTP_POST_VARS['name'],'section name');[/b] $validator->validateNumber($HTTP_POST_VARS['parent'],'parent section');
if (!$validator->foundErrors()){
$connector->query('INSERT INTO sections (name,parentid) VALUES ("'.$HTTP_POST_VARS['name'].'",'.$HTTP_POST_VARS['parent'].')');
}else{
echo '<b>Please correct '.$validator->listErrors().'</b><br><br>';
}Thanks in advance.