codeigniter

How to upload an image on CodeIgniter and display it on another page

烈酒焚心 提交于 2019-12-24 23:26:11
问题 i am still learning the codeigniter framework and just completed the news application tutorial, which lets you create a news item with a title and some text for the story. how can i get the user to be able to upload an image with the news item, and display each image when viewing the corresponding news item. ps. sorry if i made any mistakes, this is my first question create.php <h2>Create a news item</h2> <?php echo validation_errors(); ?> <?php echo form_open('news/create') ?> <?php echo

Update stripe connect account's legal entity

牧云@^-^@ 提交于 2019-12-24 22:53:51
问题 I'm retrieving a connected account thanks to Stripe PHP library, updating a few information and trying to save it. But, it throws this error message: This account can only be updated with an account token, because it was originally created with an account token. (Attempted to update param 'legal_entity' directly.) Here is my code: \Stripe\Stripe::setApiKey('sk_MYSTRIPESECRETKEY'); $account = \Stripe\Account::retrieve(ACCOUNT_ID); $account['legal_entity'] = array('dob' => array('day' => 01,

Apache2 Rewrite + ProxyPass working together

好久不见. 提交于 2019-12-24 22:50:47
问题 I have apache web server running at port 80 and flask application at port 5000. I need to process the following URLs and point to their ports accordingly. http://hello_world.com/api/v1/en/user/register http://hello_world.com/api/docs/ http://hello_world.com What I need to do is If the URL is http://hello_world.com , point it to my code_igniter router at index.php. If the URL is http://hello_world.com/api/docs/ , do not point to code_igniter, access straight to that folder. If the URL is http:

include function used before CodeIgniter class changes the view loading order

◇◆丶佛笑我妖孽 提交于 2019-12-24 22:50:25
问题 Ok, so my code looks like this: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); require_once("/application/controllers/base/genericPageC.php"); class TutorialsC extends GenericPageC { function __construct() { parent::__construct(); } protected function loadPage($args) { // ... } } /* End of file tutorialsC.php */ /* Location: ./application/controllers/pages/tutorialsC.php */ The require_once statement is present so I can have my inheritance. Now, when I didn't have

jquery function not redirecting url

倖福魔咒の 提交于 2019-12-24 22:35:22
问题 I am working with codeigniter and jquery. I am using ajax to send some info to a codeigniter function to perform a db operation , in order to update the page. After the operation is complete I am trying to refresh the page. However the refresh works inconsistently and usually I have to reload the page manually. I see no errors in firebug: var message = $('#send_message').val() if ((searchIDs).length>0){ alert("searchIDs "+searchIDs ); $.ajax({ type: "POST", url: "AjaxController/update", data:

Codeigniter - Creating own helper

妖精的绣舞 提交于 2019-12-24 21:43:43
问题 I try to create my own helper. First i create a file called HelperModelBase. This is a abstract class. abstract class Pasaj_Model_Base { public $table_name; public $table_alias; public $class_name; public $lastSql; public function __construct() { $this->class_name = get_class($this); $this->table_name = strtolower($this->class_name); $this->table_name = str_replace('_dbview', '', $this->table_name); } and create a method called select public function select($where = null, $order = null,

codeigniter uri segment not working properly getting output as 0

纵饮孤独 提交于 2019-12-24 21:22:44
问题 localhost/backend/administrator/authentication/8218/0 In codeigniter, I want to fetch these values 8218 and 0. My code is: class Administrator extends Controller { function Administrator() { parent::Controller(); $this->load->library('uri'); } function authentication() { echo $seg1= $this->uri->segment(3); echo $seg2 = $this->uri->segment(4); echo $this->uri->total_segments(); } } I am not getting any output, but I got out put as '0' when I used $this->uri->total_segments(); my config.php

CodeIgniter issue with database

落爺英雄遲暮 提交于 2019-12-24 21:14:53
问题 I am following a beginner's tutorial for CodeIgniter, but I can't get the view to load correctly because I have a database connection error. I have followed everything step-by-step, and gone through it again several times, but not been able to fix it. Could someone please help me, or at least explain why this is happening? Here is the database configuration I currently have setup: $active_group = 'default'; $active_record = TRUE; $db['default']['hostname'] = 'localhost'; $db['default'][

PHP - MYSQL Unkown Column in WHERE Join

筅森魡賤 提交于 2019-12-24 21:12:20
问题 I have a generated query using CodeIgniter and datatables. The query looks like this: SELECT `tbl_leads`.*, t2`.`username` as `namexx` FROM `tbl_leads` JOIN `tbl_users` AS `t2` ON `t2`.`user_id` = JSON_UNQUOTE(JSON_EXTRACT(JSON_KEYS(tbl_leads.permission), '$[0]')) WHERE ( `tbl_leads`.`lead_name` LIKE '%d%' ESCAPE '!' OR `tbl_leads`.`contact_name` LIKE '%d%' ESCAPE '!' OR `tbl_leads`.`email` LIKE '%d%' ESCAPE '!' OR `tbl_leads`.`phone` LIKE '%d%' ESCAPE '!' OR `tbl_leads`.`lead_status_id` LIKE

How to implement doughnut ChartJS with CodeIgniter 3 and display data from database

牧云@^-^@ 提交于 2019-12-24 21:10:01
问题 I've been trying to get doughnut chart to work with my CI3 application to no avail as this is my first time trying ChartJS out. What I tried -PHP public function get( $data ) { if ( $this->input->is_ajax_request() ) { $this->load->library('user_utils'); if ( $data == 'subscriptions' ) { $this->load->model('Fetcher', 'fetcher'); $options = [ // Database specific key/value pairs ]; $fetch = $this->fetcher->fetch( 'where', $options ); if ( $fetch ) { echo json_encode( $fetch->result_array() ); /