bonjour a tous
je suis entrains developpez un script pour visualiser un panier d'achat mais j'ai l'erreur qui indique que je ferme pas correctement mon script certes que je vois pas où j'ai mal fermé mon script.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
 
  <html>
  <head>
   <title>ton panier </title>
     <style>
      h2 { font-family: Arial, Helvetica, sans-serif; font-size: 22px; color = red; margin = 6px }
      body { font-family: Arial, Helvetica, sans-serif; font-size: 13px }
      li, td { font-family: Arial, Helvetica, sans-serif; font-size: 13px }
      hr { color: #FF0000; width=70%; text-align=center}
      a { color: #000000 }
    </style>
  </head>
  <body>
  <table width=100% border=0 cellspacing = 0 bgcolor=#cccccc>
  <tr>
  <td rowspan = 2>
  <a href = "index.php"><img src="./imagenes/cart.gif" alt="Bookorama" border=0
       align=left valign=bottom height = 60 width = 247></a>
<?php
 
   session_start();
 
   //fonction que s'encharge de changer 
  // le vecteur que je passe URL  
   function array_recibe($url_array)
   {
     $tmp = stripslashes(serialize($url_array));
     $tmp = urldecode($tmp);
     $tmp = unserialize($tmp);
     return $tmp;
   }
 
  // je recois le vecteur que je passe dans URL 
    $vector=$_GET['caro'];
   $carro=array_recibe($vector);
   if(isset($_SESSION['carro']))
     $carro=$_SESSION['carro'];
   else
     $carro=false;
 
 
  $images=1;
 
  echo "<br>";
  echo "<table border = 0 width = 100% cellspacing = 0>
        <form action = show_cart.php method = post>
        <tr><th colspan = ". (1+$images) ." bgcolor=\"#cccccc\">Item</th>
        <th bgcolor=\"#cccccc\">Price</th><th bgcolor=\"#cccccc\">Quantity</th>
        <th bgcolor=\"#cccccc\">Total</th></tr>";
   $contador=0;
   $suma=0;
   echo "<tr>";
   echo "<br>";
   foreach($carro as $k => $v)
   {
       $subto=$v['cantidad']*$v['price'];
       $suma=$suma+$subto;
       $contador++;
       echo "<td align =\" left\">";
       echo "<td>".$v['title']."</td>";
       echo "<td> ".$v['price']."</td>";
       echo "<td width='43' align='center'>".$v['cantidad']."</td>";?>
       <td width="136" align="center">
       <input name="cantidad" type="hidden" type="text" id="cantidad" value="<?php echo $v['cantidad'] ?>" size="8">
       <?php
         echo "<th bgcolor=\"#cccccc\">Total de Artículos:</th></tr>";count($carro);
       ?>
       </span>
       </div><br><td align="center"><a href="borracar.php?isbn=".$v['isbn'].""><img src="./imagenes/carro.jpg" width="12" height="14" border="0"></a></td>
       </tr></form>
   <?php}
    echo "<tr>";
    echo "<th bgcolor=\"#cccccc\">Total articles:</th></tr>";count($carro);
?>
merci à votre aide
Cordialement