ページのリダイレクトについて助けを求めたい..データを追加した後、すべての製品が表示されている特定のページにページを直接移動したい..私が期待しているリンクは
'http://localhost/CrudApp/index.php/GetProductController' ですが、私が得ているのはこれです:
「http://localhost/CrudApp/index.php/index.php/index.php/GetProductController」の結果、404 ページが見つかりません..助けてください。前もって感謝します..
ここに私のコードがあります:
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>
そして私のコントローラー: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');
}
config.php も構成します。baseurl は「index.php」です。