Ver Mensaje Individual
  #4 (permalink)  
Antiguo 02/01/2009, 22:21
thezzin
 
Fecha de Ingreso: septiembre-2008
Mensajes: 350
Antigüedad: 15 años, 7 meses
Puntos: 31
Respuesta: Formulario Flash -> Generar txt a través de PHP

lo que tienes que hacer es agregar una nueva variable submittedData.inputDatab = inputDatab.text; al código del Flash y
agregar las cajas de texto.
y para que php Reescriba los datos en el file de texto cambia ( a ) por ( w+ )

Código PHP:
function enviarDatosAlTextfile() {      
submittedData = new LoadVars();
    
submittedData.inputData inputData.text;
//agregar una nueva una variable para una nueva caja de texto y así sucesivamente.
submittedData.inputDatab inputDatab.text;

response = new LoadVars(); 
response.onLoad doThisOnResponse;      
submittedData.sendAndLoad("FilePHP.php"response"post");      
};

function 
doThisOnResponse(result) { 
if(
result){           
//responsetxtb.text = response.receivedData;                 
statustxtb.text response.writeStatus;           
}else {
Errortrace.text "Error algo salió mal. o El Fichero PHP Tiene un Error";      
   }; 
}; 
submit.onRelease = function() { 
enviarDatosAlTextfile(); 
}; 
y también modificar el código php algo así como este
Código PHP:
<?php
$textf 
'myArchivoTest.txt';
//Recibe los datos del formulario de Flash
$RecibeA $_POST['inputData'];
$RecibeB $_POST['inputDatab']; 
/*para lo que tu quieres::: &descripcion=Textocuadrotxt1//Textocuadrotxt2//...Textocuadrotxt7&
 puedes hacer un arreglo algo así y así sucesivamente.
 */
$RecibeDeFlash "descripcion_1 = ".$RecibeA ." descripcion_2 = ".$RecibeB;
//y para que el file php Reescriba los datos en el file txt puedes cambia ( a ) por ( W+ )
$fpfopen("$textf","w+");
$ecribeEnArchivoTxt fwrite ($fp,"$RecibeDeFlash");

if(
$ecribeEnArchivoTxt){           
echo 
"&writeStatus=El texto fue escrito en el Archivo $textf \n".$RecibeDeFlash;           
}else{        
echo 
"&writeStatus=Error! No se escribio en el Archivo $textf";           
fclose($fp);     
}
//echo "&receivedData=".$RecibeDeFlash; 
?>
hecha un Vistazo a las Variables GET y POST y fwrite en la Web de PHP
http://us3.php.net/variables.external

http://us3.php.net/manual/es/function.fwrite.php

Recuerda que ese código flash ya lleva otra variable y tienes que agregar una nueva caja de texto con
el Nombre*/*Instance Name: inputDatab y en Text Type Input text

Última edición por thezzin; 02/01/2009 a las 22:36