Skip to content
Advertisement

How to send value from view to controller?

When logging in, the system will retrieve information from that account and show it through the view page, which when we want to press a button to another page to display the information on that page by removing the information on the view page. How is it written? The information here refers to the logged-in user ID.

JavaScript

This is the controller.

JavaScript

I use Codeigniter and PHP to write it.

Advertisement

Answer

CodeIgniter has its own Session Class

(1). First, load session library in your config.php File.

JavaScript

(2). In your controller.php create an array to store your session data.

JavaScript

(3). retrieve from session:-

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement