Note that there are some explanatory texts on larger screens.

plurals
  1. POError in redirecting page in Codeigniter
    primarykey
    data
    text
    <p>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</p> <p>'http://localhost/CrudApp/index.php/GetProductController' , but what I'm getting at is this:</p> <p>'http://localhost/CrudApp/index.php/index.php/index.php/GetProductController' resulting a 404 Page not found.. please, some help. Thanks in advance..</p> <p>here is my code:</p> <p>AddProduct.php</p> <pre><code> &lt;form method="POST" action="SaveProductController"&gt;&lt;/br&gt;&lt;/br&gt;&lt;/br&gt; &lt;table border='1' align='center'&gt; &lt;tr&gt; &lt;td&gt;ID: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="id" value="&lt;?php echo $GetProductId-&gt;id + 1; ?&gt;" readonly="readonly"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Description: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="description"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Price: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="price"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Size: &lt;/td&gt;&lt;td&gt;&lt;input type="text" name="size"&gt;&lt;td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Aisle: &lt;/td&gt;&lt;td&gt;&lt;select name="aisle"&gt; &lt;?php foreach ($GetAisle as $row) { printf("&lt;option value='" . $row['id'] . "'&gt;" . $row['description'] . "&lt;/option&gt;"); } ?&gt; &lt;/select&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;input type="submit" name="addProduct" value="Add Product"&gt;&lt;td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>and my controller: SaveProductController.php</p> <pre><code>function index() { $this-&gt;load-&gt;model('ProductDao'); $id = $this-&gt;input-&gt;post('id'); $description = $this-&gt;input-&gt;post('description'); $price = $this-&gt;input-&gt;post('price'); $size = $this-&gt;input-&gt;post('size'); $aisle = $this-&gt;input-&gt;post('aisle'); //$this-&gt;ProductDao-&gt;saveProduct($id, $description, $price, $size, $aisle); redirect('/GetProductController'); } </code></pre> <p>i also configure my config.php, my baseurl is 'index.php'</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload