Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/11/2010, 07:55
Ghosty
 
Fecha de Ingreso: junio-2008
Mensajes: 292
Antigüedad: 18 años, 4 meses
Puntos: 4
pasar variables de flash a php no funciona

Hola amigos intento pasar datos de un campo de introduccion de texto de flash a un archivo php para guardar una imagen con el mail del usuario como nombre. tengo este codigo pero al guardar la imagen me pone lo siguiente:

undefined2ac85amicamiseta.jpg

Codigo flash
Código PHP:
function sendData(pixels:Array, h:Number, w:Number, nombre:Array)
{
    
//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;
    
    
//The page (and this movie itself) should be in a server to work
    
output.send("show.php","output","nombre","POST");
    
} 
Codigo PHP

Código PHP:
    //Output image and clean
    
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 ); 

donde $nombre debe de ser el nombre del usuario. Espero que me podais ayudar.gracias