Warning: include(shopping?buy=0.php) [function.include]: failed to open stream: No such file or directory in C:\wamp\www\Php\Grahamne\index.php on line 50
Warning: include() [function.include]: Failed opening 'shopping?buy=0.php' for inclusion (include_path='.;C:\php5\pear') in C:\wamp\www\Php\Grahamne\index.php on line 50
<?php include("db.php");
if(!isset($_SESSION['cart']))
{
$_SESSION['cart']=array();
}
if(isset($_GET['buy']))
{
$_SESSION['cart'][]=$_GET['buy'];
header('location:'.$_SERVER['PHP_SELF'].'?'.SID);
exit();
}
$items = array('pie','muffin','cake','apple');
$prices = array(1,2,3,4);
?>
<?php echo count($_SESSION['cart']);?>
<table td align="center" id=topTen>
<tr>
<th>Item</th>
<th>Cost</th>
<th>buy</th>
</tr>
<?php for($i =0; $i<count($items);$i++)
{
echo '</tr>';
echo '<td>'.$items[$i].'</td>';
echo '<td>'.number_format($prices[$i],2).'</td>';
echo '<td><a href="http://localhost/Php/Grahamne/index.php ... uy</a></td>';
echo '</tr>';
}
?>
</table>