codeigniter

load view within div tag using codeigniter

穿精又带淫゛_ 提交于 2019-12-25 05:14:00
问题 I am using codeigniter for my website.i had a situation to load a view within another view.how could i do this.Codeigniter follows the MVC pattern so we cannot directly load the another view without the help of controller. here is my menuview page <table align="center" width="200" border="0" style="margin-left:160px"> <tr align="left"> <td ><input type="radio" id="R1" name="R1" value="1" />PieChart</td> <td><input type="radio" id="R1" name="R1" value="2" />BarChart</td></tr></table> <div

codeigniter - form's action property - how to specify full app path in javascript

三世轮回 提交于 2019-12-25 05:11:13
问题 i have the following javascript in my view: $.ajax({ url:"<?php echo site_url('switches/showknownvlans/'.$ip.'/'.$hardwaremodel);?>", type:'POST', dataType:'json', success: function(returnDataFromController) { //alert(returnDataFromController.length); var htmlstring; var submitFormHTML; htmlstring = "some html stuff"; for(i = 0; i < returnDataFromController.length; i++) { } submitFormHTML = "<form method='post' accept-charset='utf-8' action='controllerX/methodABC/"+ $('#ip').val() +"/" + $('

Need help about php framework (codeigniter)

╄→гoц情女王★ 提交于 2019-12-25 05:10:05
问题 I know php well. But I am a very new learner of php framework . I am learning codeigniter 2.0.3. I am trying to develop a simple hello world application. I have tried this code.. class Hello extends Controller{ function Hello(){ parent::Controller(); } function you(){ $this->load->view("you_view"); } } But unfortunately I am receiving this error ... Fatal error: Class 'Controller' not found in C:\wamp\www\CodeIgniter\application\controllers\hello_world.php on line 7 回答1: Should be: class

Codeigniter Tank Auth add folder upon registration

独自空忆成欢 提交于 2019-12-25 05:03:59
问题 I have downloaded Tank Auth and am trying to create a folder when the user registers. I have edited the create_user() function in the users.php model like so but the folder does not get created. I am on Windows 7 so I thought maybe it was a permission thing. I turned off UAC, but it still does not work. I want the folder to end up it the root directory where the index.php is (outside of application folder). function create_user($data, $activated = TRUE) { $data['created'] = date('Y-m-d H:i:s'

Meta Cache or Codeigniter Cache

寵の児 提交于 2019-12-25 05:03:25
问题 Which cache should i make use to reduce the loading time of a page - Meta Cache or Codeigniter Caching. Please suggest. 回答1: for me i tried CI Cache and it was good ... most of the people will say that this is your own choice and you have to decide based on your project requirement .. but for sure the best answer is to try this and try that then chose the best for your case 回答2: Depends what are your needs. If you don't need some more specific and it's no problem with caching the entire page,

Codeigniter generate simple array from database

爱⌒轻易说出口 提交于 2019-12-25 05:02:04
问题 i have database with two values id and val so i want to ask how i can generate simple array like this array('value', 'value2', 'value3'...); I have $query = $this->db->query('SELECT val FROM table'); echo $query->result_array(); But it will result something like that: Array ( [0] => Array ( [val] => value ) [1] => Array ( [val] => value2 ) ) And i want it in one array so please if you can help me. Thanks for all answers :) 回答1: $query = $this->db->query('SELECT val FROM table')->result_array(

Incrementing Operator in Foreach Loop for Pagination

久未见 提交于 2019-12-25 04:59:16
问题 I'm using CodeIgniter Pagination class to paginate my data 10 rows per page. I'm using foreach loop for that. My problem is, the loop incrementing operator is reset back to 1 in the second, third & next pagination pages. Page 1 screenshot [dummy data only]: Page 2 screenshot [dummy data only]: Page 3 screenshot [dummy data only]: My controller: <?php class Mypagination extends CI_Controller{ function index(){ $this->load->database(); $this->load->library('pagination'); $config['base_url'] = '

is there a way to stop HTMLPurifier/CSStidy from forcing input CSS into all lowercase?

折月煮酒 提交于 2019-12-25 04:58:11
问题 Using PHP/Codeigniter/HTMLPurifier/CSStidy like so: require_once 'extra/htmlpurifier-4_4_0/library/HTMLPurifier.auto.php'; require_once 'extra/csstidy-1_3/class.csstidy.php'; $input_css = $this->input->post('input_css'); $config = HTMLPurifier_Config::createDefault(); $config->set('Filter.ExtractStyleBlocks', TRUE); // Create a new purifier instance $purifier = new HTMLPurifier($config); // Wrap our CSS in style tags and pass to purifier. // we're not actually interested in the html response

Remove license check from script code in CodeIgniter

浪尽此生 提交于 2019-12-25 04:58:08
问题 I have a script in Codeigniter which includes a line of code automatically. I have tried to remove it many times but it's not being removed. <script> $(function(){ $.getScript("https://activeitzone.com/check/shop.js"); }); </script> This line of code is automatically included at the end of page and out of the tag. 回答1: Remove the following lines in System > Core > config.php if ($index == '') { return base64_decode(

Getting errors when calling functions inside stored procedure

ぃ、小莉子 提交于 2019-12-25 04:57:23
问题 I am writing a stored procedure to manage leaves of employees in a company. Leave should be credited to each employee periodically. My code is as follows DROP FUNCTION IF EXISTS inserter; DELIMITER $$; CREATE FUNCTION inserter(emp_id bigint, lpc_id int) RETURNS boolean DETERMINISTIC BEGIN INSERT INTO aaa_test (aaa_emp_id,aaa_lpc_id) VALUES (emp_id,lpc_id); RETURN 1; END $$; DELIMITER ; DROP PROCEDURE IF EXISTS start_credit_test; DELIMITER $$; CREATE PROCEDURE start_credit_test() BEGIN DECLARE