Page 1 of 1

Adding Section Query

Posted: Fri Aug 14, 2009 7:57 am
by jonnygrim
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().

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>';
    }
The section in bold is line 30, any ideas how to get round this would be great.

Thanks in advance.

Re: Adding Section Query

Posted: Fri Aug 14, 2009 8:29 am
by infiniteacuity
You should check to see if the validator class actually contains the function you are calling.