i have a little problem in a "add to basket" that i made.
if i choose in 1.php some books and than i submit the form, is all ok, but after if i want to see the basket, it does not show me any books in it.
need advice pls?
1.php
...
<input type="checkbox" name="id[]" value="<?=$id;?>">
...
2.php
Code: Select all
<?php
session_start();
$n=count($_POST['id']);
?>
<table align="left" cellspacing="2" cellpadding="2" border="1">
<tr>
<td><b>id</b></td>
</tr>
<?php
for($i=0;$i<$n;$i++) {
$_SESSION['id'][$i]=$_POST['id'][$i];
?>
<tr>
<td><?=$_SESSION['id'][$i];?></td>
</tr>
<?php
} // end for
?>
</table>