上传图像文件时出现此错误

时间:2015-11-14 10:24:52

标签: php

  

致命错误:调用成员函数upload_image_and_thumbnail()   / home /.....

中的非对象

我的代码

<?  common::user_access_only("admin");
$q->select()
->from("maincategory")
->run();
$data =  $q->get_selected();

if(isset($_POST['add']))
{
    validate();
    if(form_validation::validate_fields())
    {
        $title=common::get_control_value("title");

        $descri=common::get_control_value("description");
        $featureimage=common::get_control_value("icon");

       if($_FILES['featureimage']['size']>0)
        {
            $featureimage=$imgfun->upload_image_and_thumbnail('featureimage',120,80,'userfiles','contents',false);
        }
        $q=new Query();
        $q->insert_into("maincategory",array("title"=>$title,"description"=>$descri,"icon"=>$featureimage))
        ->run();
        common::set_message(3);          common::redirect_to(common::get_component_link(array("maincategory","add")));
    }
}?>

我该怎么做才能解决这个问题?

0 个答案:

没有答案