有关如何简化此代码的任何建议?

Example 1:

    $name                =$this->input->post('name', TRUE); 
    $address             =$this->input->post('address', TRUE);
    $website             =$this->input->post('website', TRUE);
    $phone               =$this->input->post('phone', TRUE);
    $fax                 =$this->input->post('fax', TRUE);  

It make me some many code, because I allow user to input many information....

Use a loop:

$fields = array('name', 'address', 'website', 'phone', 'fax');

foreach($fields as $field) {
    ${$field} = $this->input->post($field, TRUE);
}

You can build an array and walk through it.

$fields = array(); // Use an array rather than single variables
$my_fields = array("name", "address", "website"); // etc. etc.

foreach ($my_fields as $field)
 $fields[$field] = $this->input->post($field, TRUE);

print_r($fields); // A nice array with all the field values

well the better way would be grouping the variables in an array:

$keys = array ('name', 'address', 'website', 'phone', 'fax');
$data = array();
foreach($keys as $k){
    $data[$k] = $this->input->post($k, TRUE);
}

you can always extract $data if you like, but i prefer keeping it in the array

you should put it in a function:

function fromRequest($method='post', $keys) {
    if ($method != 'post' && $method!= 'get') { throw new Exception('Invalid method'); }
    $data = array();
    foreach($keys as $k)
        $data[$k] = $this->input->$method($k, TRUE);
    return $data;
}