Questions tagged [codeigniter-2]

CodeIgniter 2.x is an old and no longer supported version of the popular PHP framework. Please refer to the [codeigniter] tag for more information.

Codeigniter 2.x is an old and no longer supported version of the popular PHP framework.

The last 2.x version (2.2.6) was released on October 31st, 2015, which is also the date when security maintenance support for the 2.x version tree was officially ended.

For more up-to-date information on the Codeigniter framework, please refer to the tag.

Links:

3146 questions
10
votes
1 answer

IonAuth - seems to be randomly logging me out

I'm using ionAuth & it seems to be logging me out almost randomly? I'm using Codeigniter v2.1.4 - it logs in perfect fine however ionAuth seems to log out at random intevals, is there a way to force the session to stay active until I call the…
Zabs
  • 13,852
  • 45
  • 173
  • 297
10
votes
2 answers

Is there any known bug in the session library of CodeIgniter 2.1.0? Why do I get kicked out?

I'm working on a website which is created with CodeIgniter 2.1.0. I've noticed sometimes when I reload a page couple of times or open a couple of pages very fast or when I have an error in the code (these errors are not related to sessions) I get…
max
  • 3,614
  • 9
  • 59
  • 107
10
votes
1 answer

How to use database codeigniter class without codeIgniter MVC framework?

My goal is to use the CodeIgniter database Class, but inside a plain PHP script. I don't want to use MVC structure for this. Can I use this database class WITHOUT using the CodeIgniter MVC pattern? If yes, how?
yarek
  • 11,278
  • 30
  • 120
  • 219
10
votes
3 answers

click jquery button + send data without form - bookmark

I'm working on a bookmarking function where the user clicks on a jQueryui button and certain information is sent to the database. But I'm not using a form, because there is no information for the user to enter. I'm pulling the user's ID from the…
chowwy
  • 1,126
  • 8
  • 26
  • 45
9
votes
4 answers

Calling stored procedure in codeigniter

I am using latest codeigniter and trying to call stored procedure from my model. Also I am using mysqli as database driver. Now I am having an error when I call two stored procedures. Following is the error: Error Number: 2014 Commands out of sync;…
Tausif Khan
  • 2,228
  • 9
  • 40
  • 51
9
votes
4 answers

How can I get the value of a codeigniter session userdata variable?

I have generated the array containing session data as, array(8) { ["session_id"]=> string(32) "1dc5eb3730601a3447650fa4453f36cd" ["ip_address"]=> string(3) "::1" ["user_agent"]=> string(102) "Mozilla/5.0 (Windows NT 6.1)…
Prateek Joshi
  • 3,929
  • 3
  • 41
  • 51
9
votes
3 answers

Object Oriented Approach in Codeigniter Model

I have been wondering what is the right way to write code in OO style in model. Certainly you can have a function that retrieve data from DB and then map to model-level variables. This approach, however, becomes counterintuitive when you have other…
Troy
  • 95
  • 1
  • 1
  • 4
9
votes
2 answers

Create Unique field in Codeigniter DBForge Migration

How can I make the financial_year field as unique using Codeigniter Dbforge migration? function up() { $this->dbforge->add_field(array( 'id' => array( 'type' => 'INT', 'constraint' => …
Anshad Vattapoyil
  • 23,145
  • 18
  • 84
  • 132
9
votes
1 answer

codeigniter - retrieve controller variables in view (using $this)

in my controller i have an public variable i want to use in my view. public $header = array("show_menu"=>true); Traditional i would pass variables as an array to the load->view("incl_header",$header) function, however i have noticed that in my view…
This_is_me
  • 908
  • 9
  • 20
9
votes
8 answers

Codeigniter blank page and error 500 in apache log?

I spent over 5 hours yesterday trying to figure out whats wrong with my setup. In the ci213/application/controllers and views directories I have a simple site.php controller and test.php view. I'm out of ideas as to why this site wont load. Anyone…
krizzo
  • 1,823
  • 5
  • 30
  • 52
8
votes
3 answers

How to implement dynamic subdomains in codeigniter with .htaccess?

How can I implement dynamic subdomains in codeigniter with .htaccess?
8
votes
3 answers

Call to undefined method CI_Controller::Controller()

I have got this controller: class Start extends CI_Controller{ var $base; var $css; function Start() { parent::Controller(); //error here. $this->base = $this->config->item('base_url'); //error here …
BlackFire27
  • 1,470
  • 5
  • 21
  • 32
8
votes
2 answers

codeigniter sess_destroy() not working properly,what m i doing wrong?

I am a newbie in codeigniter. I am using an an login form to login as an admin. When the admin logs in with the correct user name and password s/he is directed to the home page with a session variable.and then if he clicks the log out button the…
Shabib
  • 1,697
  • 4
  • 20
  • 39
8
votes
2 answers

Accessing value of public variable in codeigniter controller

Does anyone knows how to access the value of the public controller variable which has been updated by another function? code example Controller class MyController extends CI_Controller { public $variable = array(); function __construct() { …
Sam Samson
  • 927
  • 4
  • 20
  • 35
8
votes
3 answers

CodeIgniter: Validate form with multidimensional POST data

So the framework is CodeIgniter 2.0.2. I have a form that has groups of fields that correspond to rows in a database. The names of the fields are in the format: opt[0][foo] opt[0][bar] opt[1][foo] opt[1][bar] etc... The index (1,2,etc...) does…
Endophage
  • 21,038
  • 13
  • 59
  • 90