codeigniter-3

Sending emails with CodeIgniter getting PHP error

↘锁芯ラ 提交于 2019-12-12 10:22:24
问题 im trying to teach myself codeignighter and currently learning sending emails. I am trying to load the email library and i keep getting "Undefined property: Email::$load" error. Ive tried for the last hour to find the problem but cant find out whats wrong, any help is much appreciated. my email.php <?php class Email extends CI_Controller { function __construct() { parent::get_instance(); } function index() { $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com',

Codeigniter- how load new page after removing index.php

左心房为你撑大大i 提交于 2019-12-12 10:05:44
问题 I am new to codeIgniter. I have some links in my index file. I have removed index.php from url so now url look like http://localhost/app/Loader/demo_page This if my Loader code: class Loader extends CI_Controller { public function __construct(){ parent::__construct(); $this->load->helper('url'); } public function index() { $this->load->view('header'); $this->load->view('center'); $this->load->view('footer'); } public function demo_page() { $this->load->view('demo'); } } When I click on this

Value IS NOT NULL in codeigniter

本秂侑毒 提交于 2019-12-12 08:19:46
问题 I am trying to create the following statement: select * from donors where field is NOT NULL; With codeigniter, my code looks like this: $where = ['field' => NULL]; $this->db->get_where('table', $where); 回答1: when you see documentation You can use $this->db->where() with third parameter set to FALSE to not escape your query. Example: $this->db->where('field is NOT NULL', NULL, FALSE); Or you can use custom query string like this $where = "field is NOT NULL"; $this->db->where($where); So your

CodeIgniter CI_Exceptions::show_exception error after updating to PHP 7

强颜欢笑 提交于 2019-12-12 07:27:31
问题 I was using CodeIgniter 3.0.0 with PHP 5.6. Yesterday I updated to PHP 7 and started getting following error:- Uncaught TypeError: Argument 1 passed to CI_Exceptions::show_exception() must be an instance of Exception, instance of Error given, called in /my/file/path/app/system/core/Common.php on line 658 and defined in /my/file/path/hgx_portal/app/system/core/Exceptions.php:190 Stack trace: #0 /my/file/path/hgx_portal/app/system/core/Common.php(658): CI_Exceptions->show_exception(Object

How to retrieve the array values from multiples checkbox?

不想你离开。 提交于 2019-12-12 06:39:33
问题 How to retrieve the array values from multiples checkbox? I have problem when I retireve value array and echo the value. I receive this Severity: Warning Message: in_array() expects parameter 2 to be array, string given Filename: page/update.php. Pls, could you help me again. Thank you. You find three files: View, Model and Controller. Please check where I wrong... UPDATE.PHP: <?php defined('BASEPATH') OR exit('No direct script access allowed'); ?> <div class="row"> <div class="col-sm-12"> <

How can I make picture resize function when uploading in CodeIgniter

喜欢而已 提交于 2019-12-12 04:54:07
问题 I made a function on the CodeIgniter framework so users can upload pictures of products to a product page. The thing is I want pictures to be resized to the width and height I want it to be. This is my upload function in my controller: public function upload(){ $this->load->library('upload'); if(!$this->upload->do_upload('userfile')){ $error = array('error'=>$this->upload->display_errors()); $this->load->view('product_form', $error); }else{ $config['image_library'] = 'gd2'; $config['source

Codeigniter 3 email attachment from form

蹲街弑〆低调 提交于 2019-12-12 04:37:29
问题 I have a consultancy controller where users can upload their resume public function consultancy($page = 'consultancy') { if (! file_exists(APPPATH.'views/pages'.$page.'.php')) { show_404(); } $data['title'] = ucfirst($page); $this->load->view('templates/header', $data); $this->load->view('pages/'.$page, $data); $this->load->view('templates/footer', $data); } the view <form enctype="multipart/form-data" style="text-align:left;font-size:12px;" action="<?php echo base_url(); ?>postconEmail/

User name is not being echoed

耗尽温柔 提交于 2019-12-12 04:10:34
问题 I made a link on a view on the CodeIgniter framework but the name of the user profile is not being echoed on the view. The link does work though. <?php foreach($userdetail_list as $row){ ?> <tr> <td> <a href="<?php echo base_url() . 'User/userdetails/'.$row['user_id']?>"> <?php echo $row['name']; ?> </a> </td> <td> <?php echo $row['email'];?> </td> </tr> <?php } ?> As you guys can see I'm making a link to the user profile with using the user_id but I'm also trying to echo the name of the user

Only “Type=Text” & “Textarea” Re-Populates After Redirect Error; But “Select” & “Checkboxes” Doesn't in CodeIgniter 3

99封情书 提交于 2019-12-12 04:09:51
问题 Hi I am new with CI and trying to work on this form where if validation outputs error then user shouldn't loose the field values. But it only re-populates text & textarea, not checkboxes and select. Form- <span class="error"><?php echo $validation_errors; ?></span> <?php echo form_open_multipart('user/post_property'); ?> <input name="v_item_title" placeholder="Property Title Goes Here.." value="<?php echo $v_item_title; ?>" /> <textarea name="v_item_description" placeholder="Description" ><

React.JS setup with Codeigniter

别说谁变了你拦得住时间么 提交于 2019-12-12 03:48:54
问题 I'm planning to have Codeigniter and Reactjs for my new project, I need to know how to setup the project folders and the build process for the .jsx files to be .js and then all the .js files to be concatenated and minified to be min.js and also using ES6 Style . I am using NPM, please explain in details. 来源: https://stackoverflow.com/questions/42972265/react-js-setup-with-codeigniter