Jump to content


Photo

add to basket help


  • Please log in to reply
No replies to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 25 June 2006 - 02:19 AM


how can i add to basket with sessions so if the user press add to basket the session adds the items up and shows the product.

please help thank you.

my example

<? session_start();


$product="tv";
$for_sale=$_SESSION["tv"]=$product;

$price=10;
$on_sale=$_SESSION["price"]=$price;

echo "<br>price $on_sale<br> product $for_sale<br>";

?>
<html>
<body>

<form method="post" action"">
<input type="text" name="for_sale" value="<? echo $for_sale ?>">
<input type="text" name="on_sale" value="<? echo $on_sale ?>">
<input type="submit" value="add to basket">
</form>
</body>
</html>

<?

$product="hi fi";
$for_sale=$_SESSION["tv"]=$product;

$price=20;
$on_sale=$_SESSION["price"]=$price;

echo "<br>price $on_sale<br> product $for_sale<br>";

?>


<form method="post" action"">
<input type="text" name="for_sale" value="<? echo $for_sale ?>">
<input type="text" name="on_sale" value="<? echo $on_sale ?>">
<input type="submit" value="add to basket">
</form>
</body>
</html>

<?

if(!$_POST['submit']) {

$on_sale+$on_sale;

echo"Your Basket<br>product $for_sale<br>total price $on_sale ";
}
?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users