I'm trying to return to a page that is dynamically created from data stored in a database. However when I try to return to the main dynamic page it does not work. It should on submit redirect to the page that shares the yard id for the track. Instead it just gives me a failure message

**Controller**

```
public function update_track($yard_id)
{
    $data = array(
        'track_id'=>$this->input->post('track_id'),
        'train_id'=>$this->input->post('train_id'),
        'train_direction'=>$this->input->post('train_direction'),
        'train_length' =>$this->input->post('train_length'),
        'train_hpt'=>$this->input->post('train_hpt'),
        'train_tons'=>$this->input->post('train_tons'),
        'train_status'=>$this->input->post('train_status'),
        );
        $this->load->model('atisyard_model');
        $this->atisyard_model->update_track($data);
        if($this->db->affected_rows()>0)
        {
        redirect('/atis/'.$value->yard_id);
        }
        else
        {
            echo 'failure';
        }
}

```

**View**

```
    <?=form_open('atis/update_track/'); foreach ($record as $value) {?>
<h1>Edit Track:</h1>
<b><p>Track Name: </b><?php echo $value->track_no;?></br>
<b>Track Length: </b><?php echo $value->track_length;?>'</br></br></p>
<table cellpadding="5" border="0" align="center">
<input type="hidden" name="track_id" title="track_id" value="<?php echo $value->track_id;?>">
    <tr>
        <td>Lead Engine No. / Symbol / Work Order:</td>
        <td><input type="text" name="train_id" id="train_id" size="28" maxlength="28" value="<?php echo $value->train_id;?>"></td>
    </tr>
    <tr>
        <td>Train Direction:</td>
        <td><?=form_dropdown('train_direction', $train_direction, $value->train_direction);?></td>
    </tr>
        <tr><td>Train Length:</td>
        <td><input type="text" name="train_length" id="train_length" size="4" maxlength="6" value="<?php echo $value->train_length;?>"></td>
    </tr>
    <tr><td>HP/T:</td>
        <td><input type="text" name="train_hpt" id="train_hpt" size="2" maxlength="5" value="<?php echo $value->train_hpt;?>"></td>
    </tr>
    <tr><td>Train Tons:</td>
        <td><input type="text" name="train_tons" id="train_tons" size="4" maxlength="6" value="<?php echo $value->train_tons;?>"></td>
    </tr>
        <td>Train Status:</td>
        <td> <?=form_dropdown('train_status', $train_status, $value->train_status);?></td>
    </tr>
    <tr>
    <tr><td><button id="submitbtn" >Submit</button></td></tr>
</table>
<a href="<?=site_url("atis/yard/{$value->yard_id}");?>">Back to Yard</a>
<?php } echo form_close();?>

```