Comunidad de diseño web y desarrollo en internet online

Envio variable con flash y en el php me muestra undefined

Citar            
MensajeEscrito el 17 Nov 2010 07:03 am
Hola amigos soy nuevo por aki, encantado...estoy buscando ayuda ya que estoy haciendo una aplicacion en flash con la que intento enviar los datos de un campo a un php, hasta ahi facil. el tema es que cuando envio los datos debe haber algun problema y me muestra undefined. He probado la parte php y funciona bien y si hago un trace en la salida de flash sale bien. Les voy a dejar mi codigo para que le echen un vistazo, primero les dejo la parte donde hago el send y luego el php. gracias por su ayuda.

Código ActionScript :

function sendData(pixels:Array, h:Number, w:Number)
{
    //Create the LoadVars object and pass data to PHP script
    
    var output:LoadVars = new LoadVars();
    output.img = pixels.toString();
    output.height = h;
    output.width = w;
    output.nombre = nombre_txt.text ;     trace(nombre); 
    
    //The page (and this movie itself) should be in a server to work
    output.send("show.php","output","POST");
    
    
}  


Código PHP :

  header( "Content-type: image/jpeg");
    ImageJPEG( $image, "mi_camiseta.jpg" );
    $nombre = $_POST ['nombre'];
    $prefijo = substr(md5(uniqid(rand())),0,6);
    $imageup = file_get_contents("mi_camiseta.jpg");
    file_put_contents("files_pedidos/".$nombre.$prefijo."micamiseta.jpg", $imageup);
    imagedestroy( $image );  

Por hachedocho

16 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 17 Nov 2010 02:08 pm
Si te refieres que este trace da undefined:

trace(nombre);

No tiene nada que ver con el PHP, estas trazando una variable inexistente, si quieres ver que mandas traza

trace(output.nombre)

Jorge

Por solisarg

BOFH

13669 de clabLevel

4 tutoriales
5 articulos

Genero:Masculino   Bastard Operators From Hell Premio_Secretos

Argentina

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.