• 31-12-2019, 22:53:19
    #1
    Platin üye
    Selamlar, codeigniter ile bir proje yapıyorum fakat şöyle bir sorunla karşılaştım.
    public function addService()
    {
    function seflink($text)
    {
    $find = array('Ç', 'Ş', 'Ğ', 'Ü', 'İ', 'Ö', 'ç', 'ş', 'ğ', 'ü', 'ö', 'ı', '+', '#');
    $replace = array('c', 's', 'g', 'u', 'i', 'o', 'c', 's', 'g', 'u', 'o', 'i', 'plus', 'sharp');
    $text = strtolower(str_replace($find, $replace, $text));
    $text = preg_replace("@[^A-Za-z0-9\-_\.\+]@i", ' ', $text);
    $text = trim(preg_replace('/\s+/', ' ', $text));
    $text = str_replace(' ', '-', $text);
    return $text;
    }
    
        $service = $this->input->post('service');
        $name_of_file = seflink($_FILES['file']['name']);
        $config['upload_path'] = 'assets/img/services/';
            $config['allowed_types'] = '*';
    
            $this->load->library('upload', $config);
            $this->upload->do_upload('file');
            $this->load->model('M_Services');
            $this->M_Services->addService($service, $name_of_file);
            redirect(base_url('admin/Services'), 'refresh');
        }
    Böyle bir kod yapım var Örnek Resim adlı resimi ornek-resim olarak kayıt edebiliyorum ama dosyayı assets/img/services/ konumuna Örnek Resim diye kayıt ediyor nasıl ornek-resim yaptırabilirim
  • 31-12-2019, 23:07:06
    #2
    Üyeliği durduruldu
    enesaydeniz adlı üyeden alıntı: mesajı görüntüle
    Selamlar, codeigniter ile bir proje yapıyorum fakat şöyle bir sorunla karşılaştım.
    public function addService()
    {
    function seflink($text)
    {
    $find = array('Ç', 'Ş', 'Ğ', 'Ü', 'İ', 'Ö', 'ç', 'ş', 'ğ', 'ü', 'ö', 'ı', '+', '#');
    $replace = array('c', 's', 'g', 'u', 'i', 'o', 'c', 's', 'g', 'u', 'o', 'i', 'plus', 'sharp');
    $text = strtolower(str_replace($find, $replace, $text));
    $text = preg_replace("@[^A-Za-z0-9\-_\.\+]@i", ' ', $text);
    $text = trim(preg_replace('/\s+/', ' ', $text));
    $text = str_replace(' ', '-', $text);
    return $text;
    }
    
        $service = $this->input->post('service');
        $name_of_file = seflink($_FILES['file']['name']);
        $config['upload_path'] = 'assets/img/services/';
            $config['allowed_types'] = '*';
    
            $this->load->library('upload', $config);
            $this->upload->do_upload('file');
            $this->load->model('M_Services');
            $this->M_Services->addService($service, $name_of_file);
            redirect(base_url('admin/Services'), 'refresh');
        }
    Böyle bir kod yapım var Örnek Resim adlı resimi ornek-resim olarak kayıt edebiliyorum ama dosyayı assets/img/services/ konumuna Örnek Resim diye kayıt ediyor nasıl ornek-resim yaptırabilirim
    URL title fonksiyonu kullanın
  • 31-12-2019, 23:20:01
    #3
    Platin üye
    MaveraHizmet adlı üyeden alıntı: mesajı görüntüle
    URL title fonksiyonu kullanın
    yanlış anlamadıysam seflink fonksiyonu ile aynı işlemi görüyor benim sorunum do_upload kısmına etki edebilmek
  • 20-01-2020, 18:24:28
    #4
    enesaydeniz adlı üyeden alıntı: mesajı görüntüle
    Selamlar, codeigniter ile bir proje yapıyorum fakat şöyle bir sorunla karşılaştım.
    public function addService()
    {
    function seflink($text)
    {
    $find = array('Ç', 'Ş', 'Ğ', 'Ü', 'İ', 'Ö', 'ç', 'ş', 'ğ', 'ü', 'ö', 'ı', '+', '#');
    $replace = array('c', 's', 'g', 'u', 'i', 'o', 'c', 's', 'g', 'u', 'o', 'i', 'plus', 'sharp');
    $text = strtolower(str_replace($find, $replace, $text));
    $text = preg_replace("@[^A-Za-z0-9\-_\.\+]@i", ' ', $text);
    $text = trim(preg_replace('/\s+/', ' ', $text));
    $text = str_replace(' ', '-', $text);
    return $text;
    }
    
        $service = $this->input->post('service');
        $name_of_file = seflink($_FILES['file']['name']);
        $config['upload_path'] = 'assets/img/services/';
            $config['allowed_types'] = '*';
    
            $this->load->library('upload', $config);
            $this->upload->do_upload('file');
            $this->load->model('M_Services');
            $this->M_Services->addService($service, $name_of_file);
            redirect(base_url('admin/Services'), 'refresh');
        }
    Böyle bir kod yapım var Örnek Resim adlı resimi ornek-resim olarak kayıt edebiliyorum ama dosyayı assets/img/services/ konumuna Örnek Resim diye kayıt ediyor nasıl ornek-resim yaptırabilirim
    Çözdünmü?
  • 20-01-2020, 19:42:18
    #5
    Platin üye
    refalert adlı üyeden alıntı: mesajı görüntüle
    Çözdünmü?
    Aynen codeignitera isim gönderebilirmuşuz ayarı varmış