codeigniter

PHP CodeIgniter Batch Insert Not Accepting My Array

风流意气都作罢 提交于 2020-01-17 05:05:13
问题 I'm unable to get the following code to work, and it has something to do with the forming of the array. The array is actually build after a foreach() loop runs a few times, then I want to batch insert, but it comes up malformed. Why? foreach ($results as $r) { $insert_array = array( 'ListingRid' => $r['ListingRid'], 'StreetNumber' => $r['StreetNumber'], 'StreetName' => $r['StreetName'], 'City' => $r['City'], 'State' => $r['State'], 'ZipCode' => $r['ZipCode'], 'PropertyType' => $r[

form submit in codeigniter going to blank page

こ雲淡風輕ζ 提交于 2020-01-17 04:39:04
问题 I am submitting form using form helpers and it's going to blank page and when I see the view source, the action in the view source is like this http://::1/ci1/login_validation I don't understand the ::1 in it shouldn't it be localhost:8080/ ? But if I use simple form tags like regular html it works fine? <?php echo form_open ('login_validation'); echo form_input('email'); echo form_password('password'); echo form_submit('login_submit', 'login'); echo form_close(); ?> View Source <form action=

Corrupt PDF on the fly attached to email via dompdf

狂风中的少年 提交于 2020-01-17 04:31:06
问题 I'm trying to attach a PDF on the fly to send it via email, but i'm getting it corrupted when i download it from there. I also tried to put it inside a .zip, but it didn't change the status of the .pdf itself. Here's my code: //email para o cliente $this->load->library('email'); $config['newline'] = "\r\n"; $this->email->from('contato@avanhandava.org', 'Avanhandava'); $this->email->to($this->input->post('email')); $this->email->subject('Inscrição para o Acampô'); $this->email->message($this-

How to access resources within application folder?

为君一笑 提交于 2020-01-17 04:31:06
问题 First of all, I am fully aware that a better implementation, putting resources folder alongside application (not inside), exists. So yeah. Resources = js, css, images. This is just really a requirement, so any ideas how? I tried it but it says 403 (Forbidden). 回答1: This is one of the possible solutions you can use /applications /resources .htaccess .htaccess .htaccess of applications folder contains Deny from all (it is CI default. which is the reason you get 403 Forbidden) now make an

include css js in view page of codeigniter

不羁岁月 提交于 2020-01-17 01:42:06
问题 hey everyone i'm facing a problem in codeigniter how to include css and jquery. +application +views -welcome_message.php +assets +css -template.css +js +system +user_guide. <link href='<?php echo base_url(); ?>application/assets/css/template.css' rel="stylesheet" type="text/css" /> firebug show path like:- <link type="text/css" rel="stylesheet" href="http://localhost/CodeIgniter_2.1.3/application/assets/css/template.css"> i don't understand why it's css is not working. i find this thing on

Codeigniter update_batch is not working

Deadly 提交于 2020-01-17 01:34:25
问题 I have a db table: ConfigID | Type | Key | Value -------------------------------------------------------------- 0 | "API" | "ClientID" | "iofoewi" 1 | "API" | "ClientSecret" | "eijfoiewjfioejfoiewjfoie" Take the following code: $data = array( array( 'Key' => "ClientID", 'Value' => $testAPICredential->ClientID ), array( 'Key' => "ClientSecret", 'Value' => $testAPICredential->ClientSecret ) ); try { $this->context->db->trans_start(); $this->context->db->update_batch( $this->tableName, $data,

How to populate dropdownlist from database in Codeigniter?

送分小仙女□ 提交于 2020-01-17 01:31:08
问题 I have two tables: 1. STUDENT- fields are- (studentid,studentname,batch) 2. BATCH- fields are- (batchid,batchname) I want to populate a dropdown list from the field "batchname" ( from the table "BATCH") and have the batchname selected based on the field-"batch" (from the table "Student") My controller - function update($id){ $this->load->model('mod_studentprofile'); $data['query']= $this->mod_studentprofile->student_get($id); //to retrieve information from the table "STUDENT" $data['query']=

Url routing errors in php in codeigniter

时光怂恿深爱的人放手 提交于 2020-01-16 19:40:40
问题 My login form on front page is displayed, but when it posts to other pages, the post does not happen. THe problem is that the url is like: http://sitename/users/action which is a 404 not found url. But when i hard code the path to controller, (that is, stop using base_url + "/users/action" and use base_url + "/system/application/controllers/users/action") it starts working. How can i fix this problem? 回答1: Are you using .htaccess to hide index.php ? If so, you need to take that into account

Url routing errors in php in codeigniter

☆樱花仙子☆ 提交于 2020-01-16 19:38:27
问题 My login form on front page is displayed, but when it posts to other pages, the post does not happen. THe problem is that the url is like: http://sitename/users/action which is a 404 not found url. But when i hard code the path to controller, (that is, stop using base_url + "/users/action" and use base_url + "/system/application/controllers/users/action") it starts working. How can i fix this problem? 回答1: Are you using .htaccess to hide index.php ? If so, you need to take that into account

loading configuration information in to the library

你离开我真会死。 提交于 2020-01-16 19:16:13
问题 I have my configuration detail in config.php as follows: $config["system_images"] = "path to the folder"; I have created my own library FORM , in which I need to use above value in $config["system_images"] . So I called it, $this->config->item("system_images") . I don't load any configuration file, because I use the default configuration file. But following error occurred: Parse error: syntax error, unexpected '$this' (T_VARIABLE) in D:\MYSERVER\wamp\www\ci\application\libraries\Form.php on