controller: function pdf_question() view: In this code I have created a view file having name pdf-question.php and now I want to export these question into pdf formate for this I am using mpdf codeigniter where I have load M_pdf.php library and mpdf in third party but Its not working it show me an error and i.e. So, How can I
Tag: codeigniter
Adding Item to cart not working codeigniter
I am trying to add item to cart, but its not adding. I am always getting message that cart is empty. Below is my code: controller: Output: Array ( [id] => 1 [qty] => 1 [price] => 150.00 [name] => CALPOT-1L(10GM%) [Free] ) No Item in Cart Answer As per the docs You have to fill 4 required fields id,qty,price,name
Import CSV/Excel data into MYSQL database and remove duplicate using codeigniter
Today i came across a functionality where i need to import the CSV/Excel file in to MYSQL database via codeigniter. There is a special requirement from client where he can upload the CSV/Excel file in …
AJAX response returns html content
I have an AJAX call in my codeigniter project. Here is my code: in view : and controller : but the response contains only the html content from my view. I couldn’t identify what is happening. Answer change your jquery code to change your controller code like
Index of / with blank page output on server
I uploaded my PHP(codeigniter) project on server. But when I run it I get below window project folder is in /var/www/ DocumentRoot is set in projectName.conf directory as /var/www/projectName Answer Make sure your site .conf points to the public folder and not the site root.
Calculation between three different tables in databases?
I am a beginner in programming. There are three tables is in database: tblclients, tblinvoices, tblinvoicepaymentrecords. Now, I want to show Total Due in Client Area, right now there is only Percentage Graph showing. Here is the Flow: I added a client, it goes in tblclients with client id 1. I create invoice of 10000 for Client ID 1, It
Data table Server Side Processing Arabic search won’t work correctly
I’m using Codeigniter and Data table server-side processing to get data from Database My Controller Function My Model Functions My Script it works properly and I get the result All the functions of the table work perfectly (pagination,server processing….), even search is working perfectly with English word but not ًWith Arabic, when I type the first letter of the word
NGINX server configuration for Codeigniter
/etc/nginx/conf.d/default.conf my codeigniter folder is ‘ci’ which is located in /var/www/html/ci what configuration do I need to work url rewriting?… Answer I didn’t want to change the current document root (/var/www/html) since my ‘ci’ folder is located at /var/www/html/ci. So instead, I created a new location block in /etc/nginx/conf.d/default.conf: Thanks to Mert Öksüz for suggesting to use try_files $uri $uri/
How to protect ASSETS FOLDER in codeigniter
I just wanna protect my assets folder in client side. All of my files can access public. I wanna protect it. I have rules .htaccess like below, any wrong rules there? Answer You can do two things via .htaccess (Not Tested) via index.html 1. .htaccess add .htaccess inside the assets folder 2. index.html Create index.html file inside the directory and
On localhost, two different projects share the same session
My localhost is XAMPP. The two projects are basically the same code, at least the login module. The projects are built with Codeigniter. My problem is, for example, if I logged in on Project A, then …