codeigniter-3

Where_in in codeigniter

大城市里の小女人 提交于 2020-03-03 04:26:08
问题 I'm using Codeigniter 3 to build a website. But now I have an issue with get data from database. this is my Model: public function Get($arr_condition = null) { if(!is_null($arr_condition)) { $this->db->where($arr_condition); } $query = $this->db->get('cus'); if($query->num_rows()>0) { return $query->result_array(); } return false; } In Controller, I use an array ($arr_condition) to get list conditional: $arr_condition['Cus_team'] = 1; $arr_condition['Cus_user != '] = 2; $arr_condition['Cus

How can I store validation errors related to image upload as flash massages in this Codeigniter 3 application?

房东的猫 提交于 2020-02-25 04:07:38
问题 I am working on a basic blog application with Codeigniter 3.1.8 and Bootstrap 4 . The posts, of course, have main images. There is a default image if no image is uploaded by the user. There are restrictions on image files a user can upload: $config['upload_path'] = './assets/img/posts'; $config['allowed_types'] = 'jpg|jpeg|png'; $config['max_size'] = '2048'; I have managed to display the upload error messages that correspond to the configuration above (for your curiosity and/or use, the code

How can I store validation errors related to image upload as flash massages in this Codeigniter 3 application?

白昼怎懂夜的黑 提交于 2020-02-25 04:06:18
问题 I am working on a basic blog application with Codeigniter 3.1.8 and Bootstrap 4 . The posts, of course, have main images. There is a default image if no image is uploaded by the user. There are restrictions on image files a user can upload: $config['upload_path'] = './assets/img/posts'; $config['allowed_types'] = 'jpg|jpeg|png'; $config['max_size'] = '2048'; I have managed to display the upload error messages that correspond to the configuration above (for your curiosity and/or use, the code

Unable to load libraries when using CI 3 with HMVC

微笑、不失礼 提交于 2020-02-02 06:26:04
问题 I started a Modular project in CI2 (using HMVC). I am moving the project to CI 3. I am trying to autoload the session library using config/autoload .php $autoload['libraries'] = array('database','session'); I get this error: Fatal error: Call to undefined method MY_Loader::_ci_load_class() in /srv/www/htdocs/projects/application/third_party/MX/Loader.php on line 158 Even if a manually load the library within the controller using $this->load->library('session'), i get the same error. I am

Unable to load libraries when using CI 3 with HMVC

烂漫一生 提交于 2020-02-02 06:25:46
问题 I started a Modular project in CI2 (using HMVC). I am moving the project to CI 3. I am trying to autoload the session library using config/autoload .php $autoload['libraries'] = array('database','session'); I get this error: Fatal error: Call to undefined method MY_Loader::_ci_load_class() in /srv/www/htdocs/projects/application/third_party/MX/Loader.php on line 158 Even if a manually load the library within the controller using $this->load->library('session'), i get the same error. I am

Unable to load libraries when using CI 3 with HMVC

╄→гoц情女王★ 提交于 2020-02-02 06:25:25
问题 I started a Modular project in CI2 (using HMVC). I am moving the project to CI 3. I am trying to autoload the session library using config/autoload .php $autoload['libraries'] = array('database','session'); I get this error: Fatal error: Call to undefined method MY_Loader::_ci_load_class() in /srv/www/htdocs/projects/application/third_party/MX/Loader.php on line 158 Even if a manually load the library within the controller using $this->load->library('session'), i get the same error. I am

PHP mail use FROM of multiple mail client (Yahoo | Google | Hotmail | Rediff | Personal Mail domain)

淺唱寂寞╮ 提交于 2020-01-25 19:00:10
问题 Currently I'm Using PHP mail function Or CodeIgnitor mail function to send mail. From mail id can be of any domain , example xyz@gmail.com, xyz@yahoo.com, xyz@hotmail.com Also To mail can be of any domain. My mails are sent proper when FROM is set to any mail other than that of YAHOO. Having trouble to send mail from PHP mail FROM any mail of YAHOO. Is yahoo blocking my mails ? How can I solve this problem ? 回答1: You cannot send mail successfully on behalf of the domains stated above using

How to create sitemap for static and dynamic pages

那年仲夏 提交于 2020-01-24 22:18:04
问题 I have created website using the CI framework 3.0 and still i am stuck in creating the xml sitemap for static and dynamic pages. 回答1: Your question is very clear. i'm using codeigniter with the sitemap php Library. Its awesome and has clear directions: https://github.com/evert/sitemap-php To get you started - Put the SitemapPHP folder in application/libraries Then, in your controller, in your method you call the library like: public function makeSitemap() { // APPPATH will automatically

Message: mysqli::real_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known

帅比萌擦擦* 提交于 2020-01-24 17:39:08
问题 I am new to PHP MVC CI and I am getting below error. Message: mysqli::real_connect(): php_network_getaddresses: getaddrinfo failed: No such host is known. Below is my info being passed. hostname:http://localhost:1234/Sample/ username:root password: //here Password is blank database:codeignitordb port:1234 Function $mysqli->real_connect($hostname, $this->username, $this->password, $this->database, $port, $socket, $client_flags); here $socket and $client_flags are Null Question: Am I missing

form submit in codeigniter going to blank page

こ雲淡風輕ζ 提交于 2020-01-17 04:39:04
问题 I am submitting form using form helpers and it's going to blank page and when I see the view source, the action in the view source is like this http://::1/ci1/login_validation I don't understand the ::1 in it shouldn't it be localhost:8080/ ? But if I use simple form tags like regular html it works fine? <?php echo form_open ('login_validation'); echo form_input('email'); echo form_password('password'); echo form_submit('login_submit', 'login'); echo form_close(); ?> View Source <form action=