Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/07/2009, 14:48
Avatar de hucasys
hucasys
 
Fecha de Ingreso: noviembre-2001
Ubicación: Bastante buena...
Mensajes: 816
Antigüedad: 22 años, 6 meses
Puntos: 3
Información Php form > .txt utf-8

Holas, he visto los temas relacionados y no he encontrado la forma de aplicarlo a mi código, o no he sabido hacerlo.
Lo que necesito es forzar a que el archivo txt generado sea codificado rtf-8 para que me lo lea Flash.
Cualquier ayuda se agradecerá. ;)

Dejo el código:
Código PHP:
<?php
  $saving 
$_REQUEST['saving'];
  if (
$saving == 1) { 
    
$data $_POST['data'];
    
$file "data.txt"

 
    
$fp fopen($file"w") or die("Couldn't open $file for writing!");
    
fwrite($fp$data) or die("Couldn't write values to file!"); 
 
    
fclose($fp); 
    echo 
"Saved to $file successfully!";
  }
?>
<meta http-equiv="Content-type" value="text/html; charset=UTF-8" />

<form name="form1" method="post" action="form.php?saving=1">
  <textarea name="data" cols="100" rows="10">
  <?php
    $file 
"data.txt";
    if (!empty(
$file)) {  
      
$file file_get_contents("$file");
      echo 
stripslashes($file);  
    }  
  
?>
  </textarea>
  <br>
  <input type="submit" value="Save">
</form>
__________________
La manera en que resuelves el problema, es el problema.
ROBERT FRIPP