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 4 – interactive contact forms

This example shows how to write a contact form using the CI form helper and the form_validation library.

For more information about libraries, refer to Chapter 4, Libraries, and for information about helpers, refer to Chapter 5, Helpers.

The CI controller defines a form validation setup using the form_validation library and renders a form view that uses the form_validation library setup to apply a desired validation on the submitted data by the user. If it's a success, the CI controller will render a view page displaying a success message, otherwise it will render the view page with the form and the error messages will be displayed.

The URI for this example is http://ourdomain.com/index.php/contact.

In order to ...

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