codeigniter

how to delete files after uploading in php codeigniter

最后都变了- 提交于 2020-07-10 10:25:00
问题 I am uploading multiple images using the following code: for($i=0; $i<$cpt; $i++) { $_FILES['userfile']['name']= $files['userfile']['name'][$i]; $_FILES['userfile']['type']= $files['userfile']['type'][$i]; $_FILES['userfile']['tmp_name']= $files['userfile']['tmp_name'][$i]; $_FILES['userfile']['error']= $files['userfile']['error'][$i]; $_FILES['userfile']['size']= $files['userfile']['size'][$i]; //new code $config['upload_path'] = './uploads/advert_images'; $target_path = './uploads/advert

Dynamic CSS using php

折月煮酒 提交于 2020-07-09 17:07:19
问题 Currently, I am working on PHP codeignitor framework. I have some properties suppose like color,fonts etc. saved in my database for one of fields. All I want to do is, I have some classes in the css file with default values. Like ex. I have a css class as below: .text_box{ color: pink; text-decoration: none; background-color: transparent !important; transition: all 0.2s ease-in-out 0s; } .text_box:hover{ color: blue; text-decoration: none; background-color: transparent !important; transition:

Dynamic CSS using php

∥☆過路亽.° 提交于 2020-07-09 17:05:39
问题 Currently, I am working on PHP codeignitor framework. I have some properties suppose like color,fonts etc. saved in my database for one of fields. All I want to do is, I have some classes in the css file with default values. Like ex. I have a css class as below: .text_box{ color: pink; text-decoration: none; background-color: transparent !important; transition: all 0.2s ease-in-out 0s; } .text_box:hover{ color: blue; text-decoration: none; background-color: transparent !important; transition:

Dynamic CSS using php

不问归期 提交于 2020-07-09 17:05:05
问题 Currently, I am working on PHP codeignitor framework. I have some properties suppose like color,fonts etc. saved in my database for one of fields. All I want to do is, I have some classes in the css file with default values. Like ex. I have a css class as below: .text_box{ color: pink; text-decoration: none; background-color: transparent !important; transition: all 0.2s ease-in-out 0s; } .text_box:hover{ color: blue; text-decoration: none; background-color: transparent !important; transition:

php - Session are lost after redirect in CodeIgniter 3

我的未来我决定 提交于 2020-07-09 02:32:30
问题 I would like to have some help in CodeIgniter 3. Every time I login and redirect to the index page, session is lost. Here is my code: Controller: <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Secretariat extends CI_Controller { public function __construct(){ parent::__construct(); $this->load->helper(array('form', 'url')); $this->load->model('SecretariatModel'); $this->load->model('IndiRegModel'); $this->load->model('RoomModel'); $this->load->model('BuildingModel

URL routing in PHP Codeigniter

假如想象 提交于 2020-07-08 20:42:46
问题 I am having entry in my route.php like - $route['admin/students'] = 'view_student' . Here view_student is controller name. Now when from "localhost/school/admin" page I call <a href="admin/students">Students</a> , than everything works fine; But when I change my route like - $route['/school/admin/students'] = 'view_student' , and call it from "localhost/school/admin" page as <a href="/school/admin/students">Students</a> , than 404 page is shown. Whats wrong in here? 回答1: Try this code it

Why The Select Option Didn't Showing Number?

 ̄綄美尐妖づ 提交于 2020-07-07 09:56:41
问题 i have some problems. Where my stock produk size is "100-199" The Select Option just showing this : If in my product have stock is 1-99 and 200-999 i didn't get this error. The select option is fine and showing a number. In my case stok s and stok m the select option showing the number. This my db : This is my Controller : $data['stock'] = $this->Product_model->get_product_all($id); This is my Models : public function get_product_all($id){ $this->db->select('products_shirt.*'); $this->db-

A non-numeric value encountered in phpexel

孤街浪徒 提交于 2020-06-29 20:45:19
问题 Im getting A non-numeric value encountered in xls file when I use Auto filter ,Im using PHPExel package. My opertaing system is ubantu 16.04. Using Libreoffice to view the files. My code <?php $objPHPExcel = new PHPExcel(); $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Date'); $objPHPExcel->getActiveSheet()->setCellValue('B1', 'Invoice'); $objPHPExcel->getActiveSheet()->setCellValue('C1', 'Client'); $row = 2; foreach ($values['results'] as $value) { $objPHPExcel->getActiveSheet()-

A non-numeric value encountered in phpexel

强颜欢笑 提交于 2020-06-29 20:44:34
问题 Im getting A non-numeric value encountered in xls file when I use Auto filter ,Im using PHPExel package. My opertaing system is ubantu 16.04. Using Libreoffice to view the files. My code <?php $objPHPExcel = new PHPExcel(); $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Date'); $objPHPExcel->getActiveSheet()->setCellValue('B1', 'Invoice'); $objPHPExcel->getActiveSheet()->setCellValue('C1', 'Client'); $row = 2; foreach ($values['results'] as $value) { $objPHPExcel->getActiveSheet()-

How to Translate Codeigniter Pre Formatted Query Into an Original Mysql Query (e.g $this->db->select('table1.*,table2.*,table3.*'))

…衆ロ難τιáo~ 提交于 2020-06-29 04:19:05
问题 I have a website which is using a CodeIgniter framework and almost using CodeIgniter's preformatted query class in every request to process data from database built by my ex coworker. One of the example is like this: function tampilkan_data(){ $this->db->select('barang.*,barang_keluar.*,barang_masuk.*'); $this->db->from('barang'); $this->db->join('barang_keluar', 'barang.id_barang=barang_keluar.id_barang','left'); $this->db->join('barang_masuk', 'barang.id_barang=barang_masuk.id_barang','left