PHP Cart Problem

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
CIMO
Forum Newbie
Posts: 4
Joined: Wed May 07, 2008 4:54 am

PHP Cart Problem

Post by CIMO »

Hi guys, i have a problem with my carrello.php

the code i have inserted is this:

Carrello.php

Code: Select all

<?
session_start();
 
$_SESSION['count'] = $_POST['count'];
 
if ($_SESSION['count'] > 0)
{
    $_SESSION['nome'] .= "<br>" .$_POST['nome'];
    $_SESSION['quantita'] .= "<br>" .$_POST['quantita'];
    $_SESSION['prezzo'] .= "<br>" .$_POST['prezzo'];
}
 
exit();
?>
How can i delete a selected voice? If anyone use it and want to remove one object from the list, how could do this?
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: PHP Cart Problem

Post by Jade »

I'm not exactly sure what you're doing here. Do you want to be able to delete multiple things or only one thing that has been selected?

Here's how deleting something might work:

Code: Select all

 
<?
session_start();
 
if ($_POST['someitem']) //they've selected to delete this item
    mysql_query("DELETE from TABLENAME where item_id=" . $_POST['someitem'] . ")
    or die ('cannot delete the selected item');
  
?>
 
Post Reply