Jump to content

samsalar2008

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

samsalar2008's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi this is my code but I can't see the array in echo <table> <tr> <td> <h3> <?php //if the cart is empty show the message if (!$cart && !$_POST['item']) { echo "No cart available."; $cart = array(); } else{ //if the new item added to the cart let the customer knows if ($_POST['item']) { echo "Added to your cart: " . $_POST['item']; } } ?> </h3> </td> </tr> <tr> <?php //if the cart isn't empty show the cart if ($cart) { $cart[] = $_POST['item'];} foreach($cart as $key => $value) { echo'<td> <img src="images/'.$value.'.jpg" alt="'.$value.'" /> </td> <td> <form> <p> '.$value.' = <input type="text" size="2" name="number" value="1" /> </p> </form> </td> <td> <form method="post" action="update.php"> <p> <input type="submit" name="submit" value="Update This One Item" /> </p> <form> </td> <br />'; } ?> </tr> </table>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.