Jump to content

JamesB

Members
  • Posts

    425
  • Joined

  • Last visited

Posts posted by JamesB

  1. yeh

     

    I'm not sure which event will take priority for disabling the input on this one: but both functions should be called.

     

    <input id="lol" type="text" name="form_number" size="20" onkeypress='return isNumberKey(event)' onkeydown='return isNumberKey(event)'>

     

     

    <input id="lol" type="text" name="form_number" size="20" onkeypress='return (isNumberKey(event) && function2(event))'>
    • Like 1
  2. Also in paniers.php, change

    $this->name = $nom;

    to

    $this->nom = $nom;

    and change

    foreach($_SESSION['paniers'] as $id =>$value) {$sql.=$id.",";}

    to

    foreach($_SESSION['paniers'] as $name=>$value) {$sql.="'".$name."',";}
  3. Well you are overwriting the $produit variable from the database.

    Try removing the foreach loop.

     

    Change

     

     

    <?php foreach($listproduit as $produit) { ?><tr><td><?php print $produit['name'] ?></td><td><?php print $produit['price'] ?></td><td><?php print $produit['quantity'] ?></td><td><?php print $_SESSION['cart'][$produit['name']]*$produit['quantity']?></td></tr><?php } ?>

     

    to

     

     

    <tr><td><?php print $produit['name'] ?></td><td><?php print $produit['price'] ?></td><td><?php print $produit['quantity'] ?></td><td><?php print $_SESSION['cart'][$produit['name']]*$produit['quantity']?></td></tr>
  4. You are missing a closing bracket } for:

     

    if(isset($_SESSION['cart'])){

    and

     

    <?php } else {?>

     

    Also you haven't put a semicolon at the end of these 4 PHP lines:

     

    <td><?php print $produit['name'] ?></td><td><?php print $produit['price'] ?></td><td><?php print $produit['quantity'] ?></td><td><?php print $_SESSION['cart'][$produit['name']]*$produit['quantity']?></td>
×
×
  • Create New...