tengo ya este codigo solo falta lo de la factura y no se como hacer por favor ayudenme
tengo que almacenar cuando se pulse una foto y cuando se ponga comprar se haga una factura
gracias
</head>
<body>
<p>
<?php
$archivo=fopen("productos.txt","r+");
?>
<form id="form1" name="form1" method="post" action="<?php $_SERVER['PHP_SELF']?>">;
<?php
echo "<table border='1' cellspacing='8'>";
while($producto=fgets($archivo)){
//---------------separamos el string-------------
$detalle_producto=explode(",",$producto);
$nombre=$detalle_producto[0];
$descripcion=$detalle_producto[1];
$precio=$detalle_producto[2];
$imagen=$detalle_producto[3];
//-----------------------------------------------
echo "<td><img src='imagenes/$imagen' width=150 heigth=150<br><br>$nombre<br>$descripcion<br>$prec io<br><input name='' type='text' value='0'/></td>";
}
echo "</tr></table><br><input type='submit' name='Submit' value='Comprar'/></form>";
fclose($archivo);
?>
</body>
</html>