failed to open stream error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
grahamne
Forum Newbie
Posts: 6
Joined: Mon Jun 16, 2008 2:29 pm

failed to open stream error

Post 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>
User avatar
andyhoneycutt
Forum Contributor
Posts: 468
Joined: Wed Aug 27, 2008 10:02 am
Location: Idaho Falls

Re: failed to open stream error

Post by andyhoneycutt »

I'm assuming what you've posted here is your "index.php" file that is failing the include, is that right?
Post Reply