[eluser]bigdaddysheikh[/eluser]
Hey guys,
This is by far the strangest error I have encountered.
The code works fine in different controllers, also the first method in the controller works. So I thought it could be something with the file itself, I renamed the file and tried it then. It works the first time but when clicked on again the same error appears.
Now I am dumbfound as to why this is happening and how to resolve this.
The controller methods that dont work is
Code:
function add()
{
$data["logged_in"] = $this->session->userdata('logged_in');
$data["url"][] = anchor(base_url().'index.php/admin/city/add', 'Add City');
$data["url"][] = anchor(base_url().'index.php/admin/subcity/add/'.$this->uri->segment(4), 'Add Sub Region');
$show = "subcity/subcityAdd";
$this->load->view('admin/inc/header', $data);
$this->load->view('admin/'.$show);
$this->load->view('admin/inc/footer');
}
function edit(){
$data["logged_in"] = $this->session->userdata('logged_in');
$data["url"][] = anchor(base_url().'index.php/admin/city/add', 'Add City');
$data["url"][] = anchor(base_url().'index.php/admin/subcity/add/'.$this->uri->segment(4), 'Add Sub Region');
$show = "subcity/subcityEdit_new";
$this->load->view('admin/inc/header', $data);
$this->load->view('admin/'.$show);
$this->load->view('admin/inc/footer');
}
here is the sample form file
Code:
<div id="rightCol">
<?=form_open('/admin/subcity/insert', array('class' => 'listForm')); ?>
<fieldset>
<legend>Edit Sub region</legend>
<label for="name">City Name:</label>
<input type="text" name="name" id="name" value="<?=$city[0]->name?>" /><br>
<label for="keywords">Keywords:</label>
<textarea name="keywords" id="keywords" cols="45" rows="5"><?=$city[0]->keywords?></textarea><br>
<label for="description">Description</label>
<textarea name="description" id="description" cols="45" rows="5"><?=$city[0]->description?></textarea><br>
<label for="title">Title</label>
<textarea name="title" id="title" cols="45" rows="5"><?=$city[0]->title?></textarea><br>
<button type="submit" value="Submit" class="btn"/>Submit</button>
<button type="button" value="Cancel">Cancel</button>
<input type="reset" value="Reset" class="btn"/>
<input type="hidden" value="edit" name="type">
<input type="hidden" name="cat_id" value="<?=$city[0]->cat_id?>" >
<input type="hidden" name="ID" value="<?=$this->uri->segment(4)?>" />
</fieldset>
</form>
</div>
All other controllers work fine.