codeigniter: publication in the database

I need help to post a question to the database with the answers. But, I am having problems with testing. I would appreciate it someone could check everything is correct. I'm unsure if the post action in the form (View) is correct. The outcome for pos

Same function for jquery and php validation

So I have this problem. I'm doing a server side validation and a jquery validation. In server side validation what I do is to use codeigniter's form_validation library, more specifically: $this->form_validation->set_rules('documentn', 'Passport numb

CodeIgniter Session on page display problems

I am developing one web site where i used Codeigniter.In that i used Session time out.aftet session time out if i clicked on any button or any window then my login screen appears in that window or div. eg. if i clicked on my notification box then it

Session Timeout in codeigniter dyanamicly

I have issue regarding codeigniter Timeout . I know the config folder setting session timeout manually like as l $config['sess_expiration'] = 123; but i need to the website admin manage the session time out dyanamicly in to the admin page please help

Create a PDF from specific div

Good afternoon! I need to generate a PDF from a HTML page, but from a specific div <div id="canvas"> all content is here </div> I have this function as a plugin in CodeIgniter, using mPDF function pdf($html, $filename=null) { require

CodeIgniter returns 404 for all routes, but works

I have strange problem with CodeIgniter and routing system and can't find solution for it, so: I have several routes such as 'forum/(:num)' => 'forum/category/$1', 'forum/(:num)/(page:any)' => 'forum/category/$1/$2', and them works, but return 404 c

function inside a view in codeigniter

i'm a newbie in ci, can anyone help me or give some suggestions in my code and best practice? i have a foreach statement that require to use a function for displaying a huge data. here's my sample code of view. Thank you in advance foreach($data->res

Codeigniter Libraries vs. Base Classes

I need to create some functionality that will be used by nearly all my controllers. So I need to create a custom class. Now do I do this as a Core class? Or as a library? How do these differ?I use the core class override technique when there's some b

CodeIgniter Controller Method Parameters Problem

I'm using codeigniter 2.1 and I defined a function as follows. public function reset($email, $hash) { } According to MVC architecture and OOPS concept, the function could not execute if I did not pass the parameters in the url. But in codeigniter thi

Understand CodeIgniter objects and multidimensional arrays

I'm working on a project in CodeIgniter 2 and now I'm stuck on the most basic of concepts. Model: Get an object array from my table which contains all rows that match a specific value for a field named foo. There can be one or more rows that match. I

Codeigniter 2.1, PHP - combine two functions into one

I have following two function, and I would like to know, is there any way I can combine them into one. function galerija_get_all(){ $q = $this->db->get('galerija'); return $q = $q->result_array(); } function galerija_get_all_slike(){ $q = $this-&

Codeigniter - deleting the index.php

I've been trying for hours and could not make it work. Searched for answers everywhere, and nothing seems to solve my problem. I even tried the solutions described here: Remove index.php in codeigniter 2.1.0. No luck at all. I have set the config['in

Database check and redirection to the page in question

If the admin login checked is correct it should redirect to dashboard page, but if admin login is correct or incorrect it is going to dashboard page. If it is incorrect it should go to login page. Here is the code <?php class Validate extends CI_Mode

codeigniter SELECT query function

I am new to codeigniter and trying to access data from mysql database here is my model class code function model_data($a){ $this->load->database(); $query = $this->db->query("SELECT* FROM mytable3"); return $query->result(); } fun

More than max_user_connections in the CodeIgniter application?

I'm getting what looks like rather serious database errors in my CodeIgniter application. In the log file it says: User anders already has more than 'max_user_connections' active connections And there are several hundred of those lines... I've read a

CodeIgniter 1.7.3 to 2.0+ conversion

Hello and thanks for reading. I'll get straight to the point: I have a website project that I've been building using CodeIgniter 1.7.3, which I have thoroughly enjoyed using, however I have been contemplating upgrading to CI 2.0+. I tried a straight

How to create a controller action not accessible?

In one of my controllers, i use codeigniter's form validation helper. One of my validation rules is a custom function that i created that returns true or false. Problem is, that this validation function is declared inside the controller's class. How

Count lines in the database

I'm following a tutorial on Pagination with CI/jQuery. In the tutorial they get the total number of rows by doing: $config['total_rows'] = $this->db->count_all('tblUsers'); They get the total number of users to define the pagination. However, they g

Processing large amounts of data in PHP without browser timeout

I have array of mobile numbers, around 50,000. I'm trying to process and send bulk SMS to these numbers using third-party API, but the browser will freeze for some minutes. I'm looking for a better option. Processing of the data involves checking mob