In one of my views form action suddenly stopped working. When I click on submit page stays the same.But my other forms on same domain are working fine. Then what is the problem with this form?? I am doing this in codeigniter. So what might be the reason behind this??
<form enctype="multipart/form-data" method="POST" action=<?php echo base_url()."index.php/controller_user/checker"; ?> >
<table width="100%" border="0" >
<tr>
<td>
<table>
<tr>
<td>
<div id="prj" style="display: none;">Enter Project:-
<input type="text" name="prname" required/>
</div>
<div id="project">Enter Project:-
<select class="prj_name" name="prj_name" id="prj_name" onchange="process(this.value)" tabindex="11" required>
<option selected="selected">Select Project</option>
<?php
$sql = "SELECT * FROM project ORDER BY prj_id DESC";
$query = $this->db->query($sql);
if ($query->num_rows() > 0){
foreach ($query->result() as $row){
$projectName= $row->prj_name;
$projectID=$row->prj_id;
echo '<option value="'.$projectID.'">'.$projectName.'</option>';
}//end of for loop
echo '<option value="'.'0'.'">'.'New Project'.'</option>';
}
?>
</select>
</div>
</td>
</tr>
<tr>
<td>
<input type="submit" name="submit" value="Submit"/>
</td>
</tr>
</table>
</form>
This is my controller_user/checker
function checker()
{
$projectname=$_POST['prj_name'];
if($projectname=='0')
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = '*';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$this->upload->do_upload('layout');
$data = $this->upload->data();
move_uploaded_file($_FILES["layout1"]["tmp_name"],"uploads/" . $_FILES["layout1"]
["name"]);
$file="uploads/".$_FILES["layout1"]["name"];
$this->model_user->add_user_case1($file);
}
else
{
$phase_name=$_POST['phase_name'];
//$layout=$_POST['layout'];
if($phase_name=='0')
{
$config['upload_path'] = './uploads/';
$config['allowed_types'] = '*';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$this->upload->do_upload('layout');
$data = $this->upload->data();
move_uploaded_file($_FILES["layout"]["tmp_name"],"uploads/" . $_FILES["layout"
]["name"]);
$file="uploads/".$_FILES["layout"]["name"];
/*$sql=$this->db->query("INSERT INTO phase (layout) VALUES ('$file')");*/
$this->model_user->add_user_case2($projectname,$file);
}
else
{
$plan_name=$_POST['plan_name'];
if($plan_name=='0' )
{
$this->model_user->add_user_case3($phase_name);
}
else{
$this->model_user->add_user_case4($plan_name);
}
}
}
echo '<script>alert("data registered successfully");</script>';
redirect ('controller_search','refresh');
}