codeigniter

Codeigniter session data or database query?

梦想的初衷 提交于 2019-12-24 08:18:30
问题 How can I show customer's or user's information such as Name and Surname on the header? Firstly, I have a login page. Customer and User can login to the dashboard on the same login page. While login process, it uses 2 database tables such as User and Customer. Login process system takes data from 2 database tables when customer and user login to dashboard. Model of LOGIN: private $table = "user, customer"; private $_data = array(); public function validate() { $username = $this->input->post(

Codeigniter session data or database query?

你离开我真会死。 提交于 2019-12-24 08:17:25
问题 How can I show customer's or user's information such as Name and Surname on the header? Firstly, I have a login page. Customer and User can login to the dashboard on the same login page. While login process, it uses 2 database tables such as User and Customer. Login process system takes data from 2 database tables when customer and user login to dashboard. Model of LOGIN: private $table = "user, customer"; private $_data = array(); public function validate() { $username = $this->input->post(

Multiple image uploading error in Codeigniter

折月煮酒 提交于 2019-12-24 07:59:26
问题 I am trying to upload the multiple images through my form. I have taken care of many expect like form_open_multipart, calling a name as Array in upload input. I have no issue with the images upload. I can upload multiple images successfully, but the problem comes when I select any text or non-image file with the images. I am checking scenarios that if user mixes it up (accidently select any other file with images) images with text file then some files are getting uploaded and then I get the

How to prevent duplicate records in CodeIgniter

别等时光非礼了梦想. 提交于 2019-12-24 07:48:37
问题 The person I would have selected will then appears as twice in my friends database. How do I prevent a duplicate entry going in here? I have tried using exists sql command but no luck friends model: function addFriend($username, $friendname) { $record = array('username'=> $username, 'friend' => $friendname); $this->db->insert('friends', $record); } function getFollowing($username) { $following = array(); $this->db->select('*')->from('friends')->where('username', $username); $followingSet =

Get value of all column from one table and get value of other column from second table

安稳与你 提交于 2019-12-24 07:28:14
问题 I need to get result from my database. I have two table "travels" and "airlines" and I want to get result of all the columns from travels table which is ("id","name","airline_name","price","via") and from second table which is airlines based on the columns("id","name","logo"). I want to get "logo" whose name is the same as airline_name in the travel table. What should I do? Should I used join?? So far my query is: $this->db->select(); $this->db->from('travels'); $this->db->join('airlines',

Send mail with CodeIgniter Email Library

六眼飞鱼酱① 提交于 2019-12-24 07:18:39
问题 I am getting error whenever I try sending email using code igniter. I have a form where users submits data if successful a welcome email is send to the user. Ajax file to pass the data to the controller $("#submit-details").on("submit", function(){ $.ajax({ type: 'POST', url: '<?php echo base_url() ?>'+'index.php/car/host ', data: $("#submit-details").serialize(), asyn: false, }).done(function (data) { console.log(data); }); $("#submit-details")[0].reset(); $(".contact-form, .form-btns").hide

Send mail with CodeIgniter Email Library

社会主义新天地 提交于 2019-12-24 07:18:02
问题 I am getting error whenever I try sending email using code igniter. I have a form where users submits data if successful a welcome email is send to the user. Ajax file to pass the data to the controller $("#submit-details").on("submit", function(){ $.ajax({ type: 'POST', url: '<?php echo base_url() ?>'+'index.php/car/host ', data: $("#submit-details").serialize(), asyn: false, }).done(function (data) { console.log(data); }); $("#submit-details")[0].reset(); $(".contact-form, .form-btns").hide

codeigniter Disallowed Key Characters error [duplicate]

江枫思渺然 提交于 2019-12-24 07:15:28
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: CodeIgniter Disallowed Key Characters Im trying to have a form submit to a controller were it is then inserted into a database. It worked for the past couple days but apparently i accidentally changed something because it "randomly" doesn't work. Any help would be appreciated as i couldn't figure it out after searching online. Thanks! PHP public function houses () { if ($this->input->post()) { $bedrooms = $this-

CodeIgniter with Wordpress, https with http, on AWS with Load Balancer, Wordpress permalinks not working

拈花ヽ惹草 提交于 2019-12-24 07:13:38
问题 I have the following setup. An Elastic Beanstalk Environment with a Load balancer. The web application, installed in the root, is using CodeIgniter. Wordpress is installed in the subdirectory /blog off the root. The CodeIgniter application requires https, but wordpress needs to be http. The load balancer is configured to listen on https and http, the instances behind the load balancer are http. My first configuration to manage this is a .ebextensions file in the root. This file is deployed

Sending mail with CodeIgniter using SMTP protocol not working

拜拜、爱过 提交于 2019-12-24 07:10:37
问题 I have a problem in sending mails using CI. I used the "sendmail" protocol to send mail but it is being filtered as spam. I used the SMTP protocol to solve the problem, but it's not getting sent. My code is as follows: $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => '*******@gmail.com', 'smtp_pass' => '********', 'mailtype' => 'html', 'charset' => 'iso-8859-1' ); $this->load->library('email', $config); $this->email->set