mmm... de esta forma me lanza un error
$archivo = FOPEN("data.txt" , "w");
if ($archivo) {
FPUTS($archivo, "Hola");
}
FCLOSE($archivo);
-----------------------------------------------------------------
Ahí va el codigo
Código HTML:
<?
$i=1;
$totaltotal= 0;
foreach($_POST["articulo"] as $articulo){
$item = $_POST["item"][$i];
$articulo = $_POST["articulo"][$i];
$valor = $_POST["valor"][$i];
?>
<?
$archivo = FOPEN('datos.txt' , 'w');
if ($archivo) {
FPUTS($archivo, '
<!--
function cambio( ITEM, n ) {
switch ( ITEM ) {
case "".$_POST["item"][$i]."":
document.getElementById("articulo"+n).value = "".$_POST["articulo"][$i]."";
document.getElementById("valor"+n).value = "".$_POST["valor"][$i]."";
break;
}
}
-->
');
}
FCLOSE($archivo);
?>
el error es este :
Código HTML:
Parse error: syntax error, unexpected $end in /home/prueba.php on line 27
(la linea 27 es el "?>" del final)