0

hi, i had a problem with my cart values, i am doing like this

choose product and select the value of quantity and then clickic the submit button of add to cart as:

it goes as :

http://localhost/PPP_Cart/scart.php?quantity=7&pd=3

i am using the following as:

<?php 
if (@$pd)
{
$cart[$pd]=$quantity;
}
displaycart();
?>

$cart is registered as an array if cart not existed...

then the fuction is called as:

function displaycart()
{
global $cart, $totalprice;
echo "<table>";
echo "<tr><td>Product ID</td><td>Product Name</td><td>Quantity</td><td>Total Cost</td></tr>";
$items=0;
$totalprice=0.00;
foreach (@$cart as $poneid => $qty)
{
$items+=qty;
$query="SELECT * FROM catalog WHERE id='".$_REQUEST["poneid"]."'";
$result=mysql_query($query);
while ($fetchproducts=mysql_fetch_array($result))
{
echo $fetchproducts['cost'];
echo $fetchproducts['p_name'];
}

does not show up the cart values, i do not what is wrong...

it always show 0 with 0 price, i try to select the quantity and id but something is wrong...............

1
Contributor
1
Reply
2
Views
10 Years
Discussion Span
Last Post by gavy
0

i have also using he $cart script as:

<?php
if(!session_is_registered("cart"))
{
$cart=array();
session_register("cart");
}
?>

but not working with the above code,

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.