Welcome Guest, Not a member yet? Register   Sign In
Image Resize
#1

how to resize the picture ?

350x200 

PHP Code:
   public function insert_news()
 
   {

    
$config['upload_path'      'uploads/news/';
 
       $config['allowed_types'    'gif|jpg|png';
 
       $config['encrypt_name']      = TRUE;

 
       $this->load->library('upload'$config);

 
       if ($this->upload->do_upload('news_image'))
 
       {
 
            
        $image         
$this->upload->data();
        
$image_url     $image['file_name'];
        
$db_insert     ='upload/news/'.$image_url.'';


        
$data=array(
     
         'news_title'     => $this->input->post('news_title'),
     
         'news_content'    => $this->input->post('news_content'),
     
         'news_image'    =>    $db_insert,
     
            'news_sef'=>sef($this->input->post('news_title'))
        );

        
$this->load->model('vt');
        
$result $this->vt->insert_news($data);
        if (
$result) {
            echo 
"yes";
        }else

        {
            echo 
"no";
        }

 
         
    

Reply


Messages In This Thread
Image Resize - by bgr06 - 11-02-2017, 08:16 PM
RE: Image Resize - by wahyualikram - 11-03-2017, 12:33 AM
RE: Image Resize - by ribhi21 - 11-03-2017, 09:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB