I'd like to ask some help about redirecting a page..What I want is after I add a data I want my page to be direct to a certain page where all products where displayed.. The link I'm expecting is
'http://localhost/CrudApp/index.php/GetProductController' , but what I'm getting at is this:
'http://localhost/CrudApp/index.php/index.php/index.php/GetProductController' resulting a 404 Page not found.. please, some help. Thanks in advance..
here is my code:
AddProduct.php
<form method="POST" action="SaveProductController"></br></br></br>
<table border='1' align='center'>
<tr>
<td>ID: </td><td><input type="text" name="id"
value="<?php echo $GetProductId->id + 1; ?>" readonly="readonly"></td>
</tr>
<tr>
<td>Description: </td><td><input type="text" name="description"></td>
</tr>
<tr>
<td>Price: </td><td><input type="text" name="price"></td>
</tr>
<tr>
<td>Size: </td><td><input type="text" name="size"><td>
</tr>
<tr>
<td>Aisle: </td><td><select name="aisle">
<?php
foreach ($GetAisle as $row) {
printf("<option value='" . $row['id'] . "'>" . $row['description'] . "</option>");
}
?>
</select></td>
</tr>
<tr>
<td></td><td><input type="submit" name="addProduct" value="Add Product"><td>
</tr>
</table>
</form>
and my controller: SaveProductController.php
function index() {
$this->load->model('ProductDao');
$id = $this->input->post('id');
$description = $this->input->post('description');
$price = $this->input->post('price');
$size = $this->input->post('size');
$aisle = $this->input->post('aisle');
//$this->ProductDao->saveProduct($id, $description, $price, $size, $aisle);
redirect('/GetProductController');
}
i also configure my config.php, my baseurl is 'index.php'