codeigniter

How add image into form with fields code Codeigniter

微笑、不失礼 提交于 2020-01-06 07:42:13
问题 I am new to Codeigniter and new to the MVC webdesign, i have plant insert form i want to upload image and save image name into database i tried many codes but not works please help me to write upload function plant insert form is below here <?php echo validation_errors(); ?> <?php echo form_open('AddPlant/InsertPlant')?> <div class="form-group has-error"> <label for="name">Name <span class="require">*</span></label> <input type="text" class="form-control" name="name" /> </div> <div class=

jquery ajax form submit not working with codeigniter but working otherwise

别来无恙 提交于 2020-01-06 07:34:05
问题 I tried to submit a form using jquery ajax without codeigniter just to understand how ajax works. It worked fine but now I want to do it in codeigniter (since I am developing my application in CI). It's not inserting the values in the database. I do not know how to check where the problem is This is my form in view :- <form name="article_form" method="POST" action=""> <input type="text" name="title" placeholder="Title for your article" /> <br> <textarea rows="12" name="body" placeholder="Tell

CodeIgniter cart class Arabic regex

[亡魂溺海] 提交于 2020-01-06 07:16:44
问题 The Cart.php under system/library has a regex pattern definition that is not enabling me to use Arabic for name values. This works: $data = array( 'id' => "221212", 'qty' => 1, 'price' => 21.2, 'name' => 'dasdasdas' ); But this fails because of Arabic in the name: $data = array( 'id' => "221212", 'qty' => 1, 'price' => 21.2, 'name' => 'عمر' ); Now in the Cart.php class, I found the following: // These are the regular expression rules that we use to validate the product ID and product name var

multiple update using explode & where in (codeigniter)

给你一囗甜甜゛ 提交于 2020-01-06 07:10:18
问题 Morning guys, I would like to update multiple row using explode function and where in for code igniter, but the problem is, all rows all updated. here is my controller : $ids = explode(',', $this->post('id')); $this->chatmod->update(array('id'=>$ids),$data); my model : public function update($ids=null,$data=null) { $this->db->where_in($ids); $this->db->update($this->table, $data); return true; } 回答1: For updating using column id you need to pass the column name in the where_in function like

How to Insert Arrays (Multiple rows) into Mysql using Codeigniter?

十年热恋 提交于 2020-01-06 07:07:52
问题 i have search alot and i have post somany times but i didnt get any proper answer. This is my view page - View here i have write a query for add fields dynamically for particular ref_no so help me for model and controller <div id="login_form"> <?php echo form_open(base_url().'sample/invoice'); ?> <label for="type" class="control-label">Type</label> <div><?php echo form_input(array('id'=>'type','name'=>'type'));?></div> <label for="ref" class="control-label">REF</label> <div><?php echo form

How to select from a table and Edit the information in codeIgniter

为君一笑 提交于 2020-01-06 07:00:33
问题 I am building an application with Codeigniter and in this application I am currently able to search through a database table and generate a table in the application displaying the results. The next step for me is to be able to select a row in the application search result table and redirect me to a form where I can edit the information. I wanted to know how I can do that. below I will give you the code that generates the table. If more code or information is needed just let me know. foreach (

Code igniter mail function working well in my local but not in live and raise error

走远了吗. 提交于 2020-01-06 06:56:29
问题 My codeigniter mail function was working fine in my local But the same code not working live and raise the error. I think this error was password Mismatch. But I checked my password and password was right here is my error message: An Error Was Encountered 220 smtp.googlemail.com ESMTP s189-v6sm30071511pgc.39 - gsmtp hello: 250-smtp.googlemail.com at your service, [181.224.149.217] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH 250

codeigniter - send email wamp gmail

怎甘沉沦 提交于 2020-01-06 06:53:51
问题 I read other topics but not resolved my problem.. I have this in my controller: $this->load->library("email"); $this->email->from(set_value("email"), set_value("nome"),set_value("msg")); $this->email->to("my@gmail.com"); $this->email->subject("Mensagem"); $this->email->message(set_value("msg")); $this->email->send(); echo $this->email->print_debugger(); and my library email: var $useragent = "CodeIgniter"; var $mailpath = "/usr/sbin/sendmail"; var $protocol = "smtp"; var $smtp_host = "smtp

Codeigniter: Error in loading HMVC sub module model

拟墨画扇 提交于 2020-01-06 06:44:24
问题 I am having trouble loading model in sub module controller from sub module itself. I am having few modules and sub-modules as below modules/admin/ modules/admin/models modules/admin/controllers modules/admin/views modules/admin/models/dashboard/ modules/admin/controllers/dashboard/ modules/admin/views/dashboard/ modules/admin/models/plugs/ modules/admin/controllers/plugs/ modules/admin/views/plugs/ Each M/V/C has own files in it. Now I have created model in modules/admin/models/plugs/ just

how to show ajax pagination data without refresh or reload a page in codeigniter?

只谈情不闲聊 提交于 2020-01-06 06:41:17
问题 controller: test.php public function get_exam_college($offset=null) { $this->load->library('table'); $this->load->library('pagination'); $field=$this->input->post('field'); $config['base_url'] = base_url('index.php/').'test/'; $config['total_rows'] = $this->dependent_field->count_field_exam($field); $config['per_page'] = 10; $config['full_tag_open'] = '<ul class="pagination" id="search_page_pagination">'; $config['full_tag_close'] = '</ul>'; $config['cur_tag_open'] = '<li class="active"><a