O'Reilly logo

Programming with CodeIgniter MVC by Yehuda Zadik, Eli Orr

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 2 – user feedback powered by AJAX and the jQuery UI

In this example, we will show how we can use the jQuery UI with AJAX to call a CI AJAX controller method to collect the user feedback, and submit it without refreshing/rendering a page.

We will reuse and expand the login example from Chapter 3, Usage and Scope of Controllers, so if a user is logged in, we will log the feedback with the user ID kept in the session, while if not, we will log it as anonymous user feedback.

Remember the following things:

  • Username: reg_user,
  • Password: 111111111 (9 by 1s) for regular user login

The reused and extended resources are as follows:

  • auth.php: No change here
  • ajax_handler.php: This is the new AJAX handler controller
  • users_model.php: This is the extended user ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required