Welcome Guest, Not a member yet? Register   Sign In
How can I include or Call Session Controller In to My home page ,about page ....
#1

How  Can I Include or call the my session controller file .. in to my home page .. due to session check .... ?

in php : include(session_check.php);

in CI   :.......?  

Attached Files Thumbnail(s)
       
Manikanta
Reply
#2

(This post was last modified: 05-08-2015, 07:12 AM by noobie.)

(05-08-2015, 02:38 AM)Chandini Wrote: How  Can I Include or call the my session controller file .. in to my home page .. due to session check .... ?

in php : include(session_check.php);

in CI   :.......?  

I think you are confusing Controllers, Models and Libraries (in your attached images, you write a model in a controller then load it as a `Library`!)

I suggest you read the User Guide first:
http://www.codeigniter.com/user_guide/
Reply
#3

(This post was last modified: 05-08-2015, 07:19 AM by Urastor.)

If you want to write you session check as a library, you need to put your Session_check file into the library folder:

app
----library
--------Session_check.php

You can load it via $this->load->library('Session_check'); , if the file is called Session_check.php.

But you can't simply extends CI_Controller, you need to get an instance of CI, via get_instance();

Have a look here, if you don't know how to get CI instance. Wink
http://forum.codeigniter.com/thread-61626.html

And for the purpose of learning, look here http://www.codeigniter.com/userguide3/ge...aries.html

But for simpleness, just write the Content of Session_check in the same controller or write it in a MY_Controller and extend it, instead of CI_Controller. But this is just a mention. Tongue
-.-.-.-.-.-.-.-.- Angel -.-.-.-.-.-.-.-.-
Reply




Theme © iAndrew 2016 - Forum software by © MyBB