codeigniter

Blank Output PDF using FPDF library - codeigniter

∥☆過路亽.° 提交于 2020-01-11 11:41:54
问题 I'm going to generate a PDF report using FPDF library, but the output is blank. There is no error displayed, how can I fix this problem? Anyway, I tried this code in LOCALHOST and it works perfectly, but when I upload it to the cloud, there's no output to be displayed.. I tried to make the function output like this.. $this->fpdf->OUTPUT('try.pdf','I'); but nothing happens.. NOTE: In my output, C:/backup/employee_..php, the output is in the folder, there's no error and it works fine.. but when

Codeigniter htaccess not working on godaddy?

夙愿已清 提交于 2020-01-11 11:29:34
问题 I recently moved to godaddy Linux hosting and the .htaccess doesn't seem to work. Are there any settings which need to be done for godaddy because the .htaccess was working on local xampp server as well as hostek server.I am getting "404 Not Found" error message.i am using CodeIgniter-2.2.1 framework also i have check mod_rewrite in Loaded Modules in php.ini file was not found enable from server side . My htaccess file located on root directory where my application is deployed. RewriteEngine

codeigniter - how to add up values in table column

こ雲淡風輕ζ 提交于 2020-01-11 10:33:11
问题 Trying to get the sum of the values entered within a column (af_am_msm) from my table (non_clinical_total_tests). I want to display that total within an html table. My error message is: A PHP Error was encountered - Severity: Notice - Message: Array to string conversion My MODEL: public function af_am_sum() { $this->db->select_sum('af_am_msm'); $query = $this->db->get('non_clinical_total_tests'); return $query->result(); } My CONTROLLER: public function index() { $data['af_am_total'] = $this-

Is it OK to put conditional logic on CodeIgniter Views? [closed]

有些话、适合烂在心里 提交于 2020-01-11 09:06:31
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 years ago . So I am in a dilemma at the moment. I want to implement a Login button on my site, which appears when no user is logged in. However, I want the button to change to a link to the user's profile if someone is already logged in. I don't know if the right way to do this is to put an

How to add autoload-function to CodeIgniter?

情到浓时终转凉″ 提交于 2020-01-11 08:46:10
问题 I would like to be able to use OOP and create new objects in my controllers in CodeIgniter. So I need to use an autoload-function: function __autoload( $classname ) { require_once("../records/$classname.php"); } But how can I add that to CodeIgniter? 回答1: You can add your auto loader above to app/config/config.php . I've used a similar autoload function before in this location and it's worked quite neatly. function __autoload($class) { if (strpos($class, 'CI_') !== 0) { @include_once(APPPATH

Error in installing omnipay in CodeIgniter

跟風遠走 提交于 2020-01-11 07:32:06
问题 I'm trying to add omnipay in CodeIgniter (version 2.2.4) I followed the instructions in installing composer using this link:https://philsturgeon.uk/blog/2012/05/composer-with-codeigniter/ but I'm having this error: Fatal error: Uncaught exception 'Omnipay\Common\Exception\RuntimeException' with message 'Class '\Omnipay\PayPal Express\Gateway' not found' in C:\xampp\htdocs\testserver\vendor\omnipay\common\src\Omnipay\Common\GatewayFactory.php:105 Stack trace: #0 [internal function]: Omnipay

jquery post codeigniter validation

痴心易碎 提交于 2020-01-11 07:06:50
问题 We are using jquery to .load() a form into a div We then use jquery to .post() that form to a codeigniter controller ie /app/post We then want Codeigniter to perform validation but were not sure how to return to a page to display the validation errors? If re re .load() the controller wont it re-init the object and we lose the data? Are we approaching this in the wrong way? 回答1: Store the validation messages in sessions from your controller and then show them on the corresponding view/page but

CodeIgniter Ajax form - submitting form

蹲街弑〆低调 提交于 2020-01-11 06:48:06
问题 I'm new to stackoverflow and to CodeIgniter and I'm currently experimenting on some simple code examples I have found on the Internet in order to get a start. The one I'm working on right now is a form which uses CI and Ajax (jQuery) along with saving the inputs of the form in a database and then display the most recent of them on the same page as the form. If I confused you it's the 4.7 application example from here. The initial source code lies here but I have modified it in order to work

APPPATH codeigniter doesnt work on server

拜拜、爱过 提交于 2020-01-11 05:32:05
问题 I have a problem in codeigniter - after I upload it to the server I am requiring a file in a model from libraries folder <?php require_once(APPPATH.'libraries/MY_Model.php'); Class scroll_news_model extends MY_model { public function __construct() { parent::__construct("scroll_news"); } } this code was working fine in my localhost environment but I keep getting this error after I upload it: Fatal error: require_once() [function.require]: Failed opening required 'application/libraries/MY_Model

What is the most efficient way to remove all the elements of one array from another array?

懵懂的女人 提交于 2020-01-11 04:58:04
问题 I have two arrays, array A contains a long list with some elements I want to remove. Array B is the full list of those elements that I wish to remove from array A. What is the most efficient way to achieve this? 回答1: array_diff is the obvious answer, but since you've asked for the most efficient way, here's a test $big = range(1, 90000); $remove = range(500, 600); $ts = microtime(true); $result = array_diff($big, $remove); printf("%.2f\n", microtime(true) - $ts); $ts = microtime(true); $map =