codeigniter-3

how can i post data in Codeigniter using Ajax

落爺英雄遲暮 提交于 2019-12-11 05:10:36
问题 How can i post data in Codeigniter using Ajax, am so confused this is the first time i do ajax and Codeigniter together here is my ajax code i tried to send the data to the controller method ; This is my ajax $(document).ready(function(){ $('#register_form').submit(function(evt){ var postData = $(this).serialize(); $.ajax({ url: baseURL+"admin/Products/add_product", type:'post', data:{productData:postData}, success:function(data){ } }); }); }); this is my form <?php $attribute = array( 'id'=>

Forgot password function not working in CodeIgniter

久未见 提交于 2019-12-11 04:39:48
问题 Good day! I'm trying to make a forgot password function in the CodeIgniter framework but I'm getting 2 errors when i try to send the e-mail. Some database info (I'm using phpMyAdmin): Db name: kadokado Db table name: users Db email column: email Db password column: wachtwoord My controller file (Auth.php) : <?php class Auth extends CI_Controller{ public function forgot() { $this->form_validation->set_rules('email', 'Email', 'required|valid_email'); if($this->form_validation->run() == FALSE) {

Else part is working while Autosave the data using CodeIgniter

限于喜欢 提交于 2019-12-11 04:17:33
问题 I have more than 30 fields and I am trying to save the data in the database automatically. I am able to insert the data in the database but it's continuously inserting. It's not updating the last record. It's not checking the else part. I am getting the total count of the stud_id and updating the record with the help of stud_id . Is it a good idea? public function student_autosave($data){ $sql_count_id="SELECT COUNT(stud_id) FROM student_info"; $q = $this->db->query($sql_count_id); $last

i can not remove index.php from url in codeigniter in iis server

南楼画角 提交于 2019-12-11 02:58:05
问题 I can not remove the index.php from url in IIS. Here my .htaccess file; RewriteEngine on RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ./index.php?$1 [L,QSA] also i tried the steps from codeigniter link but it didn't work for my server. it says only for apache servers. but im using iis server. even i enabled rewrite module but it didnt work again.

what should i write to redirect the page from Controller in CI?

陌路散爱 提交于 2019-12-11 02:39:35
问题 here is my Controller <?php class First_Controller extends CI_Controller{ public function index(){ $this->load->view('firstpage'); } public function validate_credentials() { $data[] =array( $username=$this->input->post('username'), $password=$this->input->post('password') ); $this->load->model('First_Model'); $result=$this->First_Model->validate($data); if($result==true) { //redirect('welcome');//Error Page is not found echo "found"; } else{ echo "not found"; } } } ?> and here is the second

CodeIgniter dynamic language functionality

你离开我真会死。 提交于 2019-12-10 19:38:51
问题 I am Codeigniter and i need dynamic language for users. I have added drop-down at the header and i want to allow users to change language of site at the frontend. i tried to change language with below code in one controller $this->config->set_item('language','spanish'); but its not working its not changing language i also tried with taking session with below code in one of my controller $mylanguage = $this->session->set_userdata(array('my_language',$dynamiclang)); and tried to access this

codeigniter 3.1 PDO mysql Error Number: 3D000/1046 No database selected

ぃ、小莉子 提交于 2019-12-10 18:47:34
问题 I had issue with upgrading codeignier 2.xx to 3.xx before and I can not found any completed answer for me. So I'd like to share how I solved it. In Codeignier official web site show how to connect PDO with Mysql as below For the PDO driver, you should use the $config[‘dsn’] setting instead of ‘hostname’ and ‘database’: $config[‘dsn’] = ‘mysql:host=localhost;dbname=mydatabase’ https://www.codeigniter.com/user_guide/database/connecting.html But I still could not make it work as it was showing

protect_identifiers issue in codeigniter 3.1.0

妖精的绣舞 提交于 2019-12-10 18:46:47
问题 In Previous version 2.2.6 i was using following code: $this->db->_protect_identifiers=false; $dataField='tm.*,IFNULL(CONCAT_WS(" " ,pm.firstName,pm.lastName),"") as assignedToName,IFNULL(cm.caseNo,"") as CaseNo,IFNULL(cm1.fileNo,"") as fileNo,IFNULL(sm.caseStage,"") as caseStage'; $qryTable='task_mst as tm LEFT JOIN case_mst as cm on tm.caseNo=cm.ID LEFT JOIN case_mst as cm1 on tm.fileNo=cm1.ID LEFT JOIN party_mst as pm on tm.assignedTo=pm.ID LEFT JOIN session_mst as sm on tm.sessionId=sm.ID'

Message: Configured database connection is persistent. Aborting

喜欢而已 提交于 2019-12-10 13:37:25
问题 Codeigniter 2 to 3 version after upgrading, I get this error.. Why would that be? An uncaught Exception was encountered Type: Exception Message: Configured database connection is persistent. Aborting. Filename: /var/www/vhosts/xxx.com/app/system/libraries/Session/drivers/Session_database_driver.php Line Number: 94 Backtrace: File: /var/www/vhosts/xxx.com/app/application/core/MY_Controller.php Line: 11 Function: __construct File: /var/www/vhosts/xxx.com/app/application/core/MY_Controller.php

echoing user information not working in Codeigniter

做~自己de王妃 提交于 2019-12-10 12:25:35
问题 Hello guys I'm making application on the codeigniter framework and I'm trying to echo user info of a specific user but its not really working. The name is not being echoed. Also all the emails of the users in my database are being echoed. ( The link to the right tuser profile works though but the name of the link doesn't. Its a blank link. This is my view file: foreach($userdetail_list as $row): ?> <tr> <td> <a href="<?php echo base_url() . 'User/userdetails/'.$row['user_id']?>"> <?php echo