[eluser]Unknown[/eluser]
I'm writing a shopping cart, but I found the contents of my shopping cart can only have a maximum of 4 pen.
So I use the following code to try, I found that the contents of only up to 6 pen
Can anyone tell me how to solve this problem?
Sorry for my bad english.
Code:
<?php for($i=0;$i<10;$i++){?>
<form action="" method="post">
<input type="hidden" value="<?php echo $i;?>" name="id">
<input type="submit">
</form>
<?php } ?>
<?php
$data = array(
'id' => $this->input->post('id'),
'qty' =>1,
'price' => '100',
'name' => 'a'
);
$this->cart->insert($data);
$cart = $this->cart->contents();
print_r($cart);
?>