codeigniter

Codeigniter website showing error 404 on Google Virtual Instant Live Server

无人久伴 提交于 2020-04-18 12:33:46
问题 When I go open up my Codeigniter website on my localhost using Wamp and XAMPP, both works. But when I move it to Ubuntu on Google Cloud, it only works for the first page, afterward, it shows the error when going to another page. I'm using: Codeigniter ver 3 Apache2 php7.3 Does anyone know what might have caused this? Other Pages 回答1: It would be ideal if you check first the class name and the record name that both should be title case (start with a capital letter). So if the class name is

How to explode the values in the array and it as a separate columns by creating it dynamically using codeigniter

霸气de小男生 提交于 2020-04-18 05:49:27
问题 public function addDynFields() { $checkedfileds=$_POST['CheckedFileds']; $fields=implode(',',$checkedfileds); $dynflds = strtolower($fields); $dynclmns = 'add_to'.'_'.$dynflds; if($fields == 'Title') { $this->db->query("ALTER TABLE `pm1asset_dynamic_fields` ADD ".$dynclmns." int(11) NOT NULL"); } else { $this->db->query("ALTER TABLE `pm1asset_dynamic_fields` ADD ".$dynclmns." varchar(255) NOT NULL"); } } Here above code is a controller code. Here $checkedfileds is a multiple check box values

How to explode the values in the array and it as a separate columns by creating it dynamically using codeigniter

核能气质少年 提交于 2020-04-18 05:49:23
问题 public function addDynFields() { $checkedfileds=$_POST['CheckedFileds']; $fields=implode(',',$checkedfileds); $dynflds = strtolower($fields); $dynclmns = 'add_to'.'_'.$dynflds; if($fields == 'Title') { $this->db->query("ALTER TABLE `pm1asset_dynamic_fields` ADD ".$dynclmns." int(11) NOT NULL"); } else { $this->db->query("ALTER TABLE `pm1asset_dynamic_fields` ADD ".$dynclmns." varchar(255) NOT NULL"); } } Here above code is a controller code. Here $checkedfileds is a multiple check box values

I am getting empty array, I need array of image while uploading multiple images in Codeigniter

徘徊边缘 提交于 2020-04-16 05:47:52
问题 This code is for getting file name in array. I am getting an empty array of file. Here I am attaching the source code for the same issue. Have look a code and give me some solution $images = array(); $count = count($_FILES['files']['name']); for($i = 0; $i < $count ; $i++) { if(!empty($_FILES['file']['name'][$i])) { $tmp = explode(".",$_FILES['files']['name'][$i]); $file_extension = end($tmp); //this is temp variable $imagename = time().".".$file_extension; // Define new $_FILES array - $

Ionic 2 - How to make a login post request?

為{幸葍}努か 提交于 2020-04-16 03:33:48
问题 I need to implement login in my Ionic 2 app. For now I just need to be sure that the email and the password are properly received and get back a basic response. I have successfully tested a GET request to the API and it is properly working, but I am not able to get the POST request working. I have tried two approaches: Using subscribe : Login component: submitLogin() { var email = this.loginForm.value.email.trim(); var password = this.loginForm.value.password.trim(); this.userService

Ionic 2 - How to make a login post request?

青春壹個敷衍的年華 提交于 2020-04-16 03:33:34
问题 I need to implement login in my Ionic 2 app. For now I just need to be sure that the email and the password are properly received and get back a basic response. I have successfully tested a GET request to the API and it is properly working, but I am not able to get the POST request working. I have tried two approaches: Using subscribe : Login component: submitLogin() { var email = this.loginForm.value.email.trim(); var password = this.loginForm.value.password.trim(); this.userService

How do I fully refresh the page in CodeIgniter?

我的未来我决定 提交于 2020-04-15 07:22:06
问题 I am loading a form in an overlay. The overlay has a separate controller and action to the page that invokes the overlay. On form submit, if successful, I simply want to reload the referring page that the overlay was loaded from. I can get the referring page to load, but it places the content inside the overlay. header("Location: www.example.com", true, 302); does not work. Using the URL helper like this: $url = $_SERVER['HTTP_REFERER']; redirect($url); Also does not work. Every time it loads

Pass multiple Arrays to view in code igniter

你。 提交于 2020-04-13 17:31:08
问题 my model is this,,, two functions view and spl function view(){ $result = $this -> db -> get('tb_ourcity'); return $result->result_array(); //$query = $this->db->query('SELECT * from `adds`'); //return $query->result_array(); } function spl(){ $result2 = $this -> db -> get('td_spei'); return $result2->result_array(); //$query = $this->db->query('SELECT * from `adds`'); //return $query->result_array(); } my controller looks like ths public function index() { $data['result']=$this->load_city-

Pass multiple Arrays to view in code igniter

亡梦爱人 提交于 2020-04-13 17:30:39
问题 my model is this,,, two functions view and spl function view(){ $result = $this -> db -> get('tb_ourcity'); return $result->result_array(); //$query = $this->db->query('SELECT * from `adds`'); //return $query->result_array(); } function spl(){ $result2 = $this -> db -> get('td_spei'); return $result2->result_array(); //$query = $this->db->query('SELECT * from `adds`'); //return $query->result_array(); } my controller looks like ths public function index() { $data['result']=$this->load_city-

Codeigniter make directory if not exist

陌路散爱 提交于 2020-04-10 03:27:33
问题 Hi can anyone help me with this. Basically I used the file uploading class of codeigniter the link is here and it works fine! but I need to know how to create directory inside this default upload path $config['upload_path'] = './uploads/' the name of the folder is the date today this is my sample code. date_default_timezone_set('Asia/Manila'); $date = date('Y-m-d H:i:s'); $config['upload_path'] = './uploads/'.$date; $config['allowed_types'] = 'jpg|jpeg|gif|png'; $config['max_size'] = '100';