O'Reilly logo

CodeIgniter 2 Cookbook by Rob Foster

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

Editing users

You will always need some method to edit users yourself from within an application. In this section, we will look at creating functionality to do just that: to update and edit user details.

How to do it...

We'll need to create one file:

  • path/to/codeigniter/application/views/users/edit_user.php

And amend the following two files:

  • path/to/codeigniter/application/controllers/users.php
  • path/to/codeigniter/application/models/users_model.php
  1. Copy the following code to the, path/to/codeigniter/application/views/users/edit_user.php file:
    <?php echo form_open('users/edit_user') ; ?> <?php if (validation_errors()) : ?> <h3>Whoops! There was an error:</h3> <p><?php echo validation_errors(); ?></p> <?php endif; ?> <table border="0" > <tr> <td>User First ...

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