Page 1 of 1

PHP Cart Problem

Posted: Wed May 07, 2008 5:00 am
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?

Re: PHP Cart Problem

Posted: Wed May 07, 2008 5:33 pm
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');
  
?>