Adding Section Query
Posted: Fri Aug 14, 2009 7:57 am
Hi,
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().
The section in bold is line 30, any ideas how to get round this would be great.
Thanks in advance.
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.