Ver Mensaje Individual
  #6 (permalink)  
Antiguo 10/12/2006, 10:20
Avatar de BLAH !!
BLAH !!
 
Fecha de Ingreso: septiembre-2003
Ubicación: Región Metropolitana, Santiago, Chile
Mensajes: 706
Antigüedad: 20 años, 7 meses
Puntos: 16
De acuerdo Re: Cambiar partes de un .txt completando un formulario

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)
__________________
Adios ...!!!!