Page 1 of 1

failed to open stream error

Posted: Thu Aug 28, 2008 6:37 am
by grahamne
This is am error which is stopping me doing pagination and shopping cart anyone wanna help a noob out a would greatly appreciate :banghead:

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>

Re: failed to open stream error

Posted: Tue Sep 02, 2008 5:32 pm
by andyhoneycutt
I'm assuming what you've posted here is your "index.php" file that is failing the include, is that right?