codeigniter

Callback function for form validation in config file

耗尽温柔 提交于 2019-12-24 15:03:05
问题 I'm trying to do an email validation whereby the domain of the email would be @abc123.com . I've separated my form validation rules into another file in the application/config folder called form_validation.php . One of my rules consists of a callback_email_check . Where should I put the function? In the main controller or together with the form_validation.php file where all my form validation rules are? I've tried putting at both options but at where I display my error message I'm getting an

codeigniter image upload watermark and thumbnail

一个人想着一个人 提交于 2019-12-24 14:54:15
问题 i am uploading an image using CI upload library work fine, problem with watermarking and image thumbnail, if id do watermarking first and then thumbnail, its doing watermarking to original image but also re-sized it thumbnail size but not keeping original size image with watermark too, if i do thumbnail first then watermark it work fine but i want thumbnail also watermarked here is my code $this->do_thumb('file_name'); $this->watermark('file_name'); function watermark($filename){ $image_cfg =

How to configure multiple database and using failover in Codeigniter

假装没事ソ 提交于 2019-12-24 14:53:09
问题 I've used Codeigniter3.0.4 as the document provide I can't configure multiple database and using 'failover' => array() . I found an errros You have not selected a database type to connect to. on my website if I used this options $active_group = 'default'; $active_record = TRUE; $db['default']['failover'] = array( array( 'hostname' => 'localhost', 'username' => 'root', 'password' => '', 'database' => 'com', 'dbdriver' => 'mysqli', 'dbprefix' => '', 'pconnect' => TRUE, 'db_debug' => TRUE,

Trying to remove index.php from URL in codeigniter [duplicate]

我只是一个虾纸丫 提交于 2019-12-24 14:33:13
问题 This question already has answers here : Remove “index.php” from URL - Codeigniter (12 answers) Closed 6 years ago . I am trying to remove 'index.php' from the URL. I have tried by making $config['uri_protocol'] = 'AUTO'; as $config['uri_protocol'] = 'REQUEST_URI'; and $config['index_page'] = 'index.php'; as $config['index_page'] = ''; and even tried with putting RewriteEngine on RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt) RewriteRule ^(.*)$

htaccess Url rewriting not working

一曲冷凌霜 提交于 2019-12-24 14:28:46
问题 I have a problem with the Apache URL rewriting, I want when the user tapes an url like this : 1 : www.site.com/country/city/smthg or 2 : www.site.com/country/city/smthg/fct or 3 : www.site.com/country/city/smthg/fct/value I want to transform the url to this: 1 : www.site.com/index.php/smthg/index/country/city 2 : www.site.com/index.php/smthg/fct/country/city 3 : www.site.com/index.php/smthg/fct/value/country/city I am using PHP Codeigniter framework, I tried this but it is not working :

Call to a member function on null error CodeIgniter

安稳与你 提交于 2019-12-24 14:19:28
问题 Please dont`t ask why I have more than one controller: this is what my teacher wants. I have 3 controllers: Api.php , Token.php and Apikey.php , where Api.php is the "main" one. PROBLEM : When I pass into the URL : http://localhost/revolution/index.php/api/registerUser/first_name/12First it seems there are problems with loading the Token controller from Api controller. ERROR: Fatal error: Call to a member function generateToken() on null What can I do? API Controller: Api.php class api

Login and upload image in codeigniter

别等时光非礼了梦想. 提交于 2019-12-24 14:13:15
问题 I am trying to create login form in the following code. After successful login , I uploaded the image and submitted. I refreshed the page and I got the following error message: A PHP Error was encountered Severity: Notice Message: Undefined index: image Filename: controllers/home.php Line Number: 89 Backtrace: File: C:\softwares\xamp\htdocs\ASOFT\Projects\CG_Pack\application\controllers\home.php Line: 89 Function: _error_handler File: C:\softwares\xamp\htdocs\ASOFT\Projects\CG_Pack

Codeigniter - get related data rows as structures/objects, not array

ⅰ亾dé卋堺 提交于 2019-12-24 14:08:39
问题 Im a newbie in CodeIgniter. I have created model for Pizza table and Ingredients table. Tables are joined by additional Pizza_Ingredients table (its many to many relation). My model: <?php class Pizza extends DataMapper { var $table = 'Pizza'; var $has_many = array( 'ingredients' => array( 'class' => 'ingredients', 'join_table' => 'pizza_ingredients' ) ); } class Ingredients extends DataMapper { var $table = 'Ingredients'; var $has_many = array( 'pizza' => array( 'class' => 'pizza', 'join

I cant get $result['query'] in my view page

徘徊边缘 提交于 2019-12-24 13:53:01
问题 My controller Erp_c: $result['query2']= $this->erp_m->selectattend1($user,$en,$year,$month); $this->load->('salview',$result); In model Erp_m: function selectattend1($user,$en,$year,$month) { $query2=$this->db->query(" SELECT COUNT(*) FROM attendance3 WHERE name = '$en' AND attend = 'Absent' AND MONTH = '$month' AND year = '$year' AND user = '$user' "); return $query2->result(); } In view page salview.php: foreach($query2 as $row) { $al=$row->count(*);///here what i put ,that is my doubt

Using Amazon MWS (Inventory API) with CodeIgniter (PHP)

橙三吉。 提交于 2019-12-24 13:52:24
问题 I'm somewhat familiar with using the Amazon MWS apis, but I'm new to CodeIgniter and the whole hmvc thing. I'm curious how I would add the api into CodeIgniter. Would I have to dissect the entire api into the appropriate mvc folders, or could I just add it as a library. If the latter is the case, how would I use the api? I'm sorry if this is vague, but I would greatly appreciate any help you're willing to offer! Thanks 回答1: I cannot say anthing specific to CodeIgniter, but I've worked with