开发者

how to use session in ajax file using codeigniter

there is a php file that i am calling using ajax through a view. xmlhttp.开发者_运维百科open("GET","/my/path/to/background_file.php");

that php file is doing some background process and hence i do not need any controller/ view for that file. its an independent file.

considering that i do not need any controller/ view for that php file, can i access session variables there ? how ?

where should i keep these kind of php files which do not need any view/ controller?

thanks in advance. i am using codeIgniter 1.7.2

dev


If you want to access objects in Codeigniters session array, I'd suggest making your ajax file a controller. It's pretty common to create an ajax controller so you can access Codeigniter's functionality. Of course, you don't need a view connected to the controller, you simply echo json_encode($data) to return any required data.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜