Adding Section Query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jonnygrim
Forum Newbie
Posts: 3
Joined: Tue Aug 11, 2009 5:48 pm

Adding Section Query

Post 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.
infiniteacuity
Forum Newbie
Posts: 12
Joined: Tue Jun 16, 2009 2:48 pm
Location: Ft. Lauderdale

Re: Adding Section Query

Post by infiniteacuity »

You should check to see if the validator class actually contains the function you are calling.
Post Reply