Comunidad de diseño web y desarrollo en internet online

Hacer un attach de una imagen y mandar a otro usuario

Citar            
MensajeEscrito el 24 Nov 2008 04:16 pm
Que tal, tengo una postal en flash que se puede colorear, le pones tus datos y se hace un post para el usuario y se manda una copia al servidor que se adjunta a un correo que se manda a destinatrios definidos. Este archivo del servidor se sobreescribe cada que un usuario manda una nueva carta para descargar a su maquina.

El problema :

Me pidieron que el usuario pueda mandar la postal a otro usuario definido desde el archivo flash.

De alguna forma se debe poder jalar la dirección de correos del swf y colocarla en los destinatarios que estan en PHP.

Estoy ocupando el PHP mailer.

Ojala alguien sepa que hacer o ya haya tenido un problemita asi. Gracias manos!

Por Troymustang

7 de clabLevel



Genero:Masculino  

safari
Citar            
MensajeEscrito el 24 Nov 2008 11:37 pm
busca en el foro en o googlea porq eso se llama formularios en flash y php no te ayudo porque estoy buscando algo parecido ;-)

Por talcual

686 de clabLevel



 

Colombia

firefox
Citar            
MensajeEscrito el 25 Nov 2008 09:34 pm
Ya busque, por eso decidi poner el la pregunta mano. Si encuentro algo antes lo publico aqui. Gracias.

Por Troymustang

7 de clabLevel



Genero:Masculino  

msie7
Citar            
MensajeEscrito el 25 Nov 2008 10:37 pm
bro mira este codigo creo q te puede solucionar ese problema yo lo estoy revisando a ver como me va

http://www.maestrosdelweb.com/editorial/fflashphpform/

Por talcual

686 de clabLevel



 

Colombia

firefox
Citar            
MensajeEscrito el 26 Nov 2008 05:03 pm
Gracias mano, ya había checado ello. De echo estoy seguro que es el Php el problematico.

Como decirle que mande el correo hasta que este cargada la imagen en el servidor. Mira, este es el codigo que manejo en PHP:

<?php

error_reporting(0);
/**
* Get the width and height of the destination image
* from the POST variables and convert them into
* integer values
*/
$w = (int)$_POST['width'];
$h = (int)$_POST['height'];

// create the image with desired width and height

$img = imagecreatetruecolor($w, $h);

// now fill the image with blank color
// do you remember i wont pass the 0xFFFFFF pixels
// from flash?
imagefill($img, 0, 0, 0xFFFFFF);

$rows = 0;
$cols = 0;

// now process every POST variable which
// contains a pixel color
for($rows = 0; $rows < $h; $rows++){
// convert the string into an array of n elements
$c_row = explode(",", $_POST['px' . $rows]);
for($cols = 0; $cols < $w; $cols++){
// get the single pixel color value
$value = $c_row[$cols];
// if value is not empty (empty values are the blank pixels)
if($value != ""){
// get the hexadecimal string (must be 6 chars length)
// so add the missing chars if needed
$hex = $value;
while(strlen($hex) < 6){
$hex = "0" . $hex;
}
// convert value from HEX to RGB
$r = hexdec(substr($hex, 0, 2));
$g = hexdec(substr($hex, 2, 2));
$b = hexdec(substr($hex, 4, 2));
// allocate the new color
// N.B. teorically if a color was already allocated
// we dont need to allocate another time
// but this is only an example
$test = imagecolorallocate($img, $r, $g, $b);
// and paste that color into the image
// at the correct position
imagesetpixel($img, $cols, $rows, $test);
}
}
}

$imagenGuardada = imagejpeg($img, "/mnt/Target01/335959/337272/tempimg.jpg", 90);
require_once("../scripts/class.phpmailer.php");

$nombre=htmlspecialchars($_GET['nombre_txt']);
$edad=htmlspecialchars($_GET['edad_txt']);
$correo=htmlspecialchars($_GET['correo_txt']);
$texto=htmlspecialchars($_GET['texto']);
$mail = new PHPMailer();

$mail->IsSMTP();
$mail->Port = 587;
$mail->Host = "";
$mail->SMTPAuth = true;
$mail->Username = "m";
$mail->Password = "qwerty";
// $mail->From = "";
$mail->FromName = "";
$mail->Subject = "";

$mail->AddAddress("[email protected]");
$pathImg = "createdimages/tempimg.jpg";
$mail->AddEmbeddedImage($pathImg,"descarga", $pathImg);
$message = "

<font face=arial size=3> <b>Carta para el Papan VI encuentro de las familias</b><br>
---------------------------------------------------<br>
---------------------------------------------------<br>
"./*Nombre: ".$nombre."<br>
Edad: ".$edad."<br>
Correo: ".$correo."<br>
Mensaje: ".$texto."<br>
---------------------------------------------------<br>
---------------------------------------------------<br>*/
"</font>";
$message.= "<img src=\"cid:descarga\" alt=\"Imagen\"/>";
$subject = utf8_decode($subject);
$message = utf8_decode($message);
$referer = utf8_decode($referer);

$mail->Body = $message;
$mail->IsHTML(true);

if($mail->Send()){
//echo "&status=ok&mensaje=".$message."&";
} else {
//echo "&status=no&mensaje=".$message."&error=".$mail->ErrorInfo."&";
}
header("Content-type:image/jpeg");header('Content-Disposition: attachment; filename="carta.jpg"');
imagejpeg($img, "", 90);
?>

Por Troymustang

7 de clabLevel



Genero:Masculino  

safari
Citar            
MensajeEscrito el 26 Nov 2008 07:11 pm
tu me dices como saber " si " la imagen esta cargada pues compañero para saber eso deberias tomar el valor total de la imagen y compararlo con un IF con lo q se ha cargado ;-) eso me parece usa un if antes de mandar el mail no creo q debas tener algun inconveniente pero bueno cualquier cosa avisa

Por talcual

686 de clabLevel



 

Colombia

firefox
Citar            
MensajeEscrito el 05 Dic 2008 07:33 pm
Perdón pero no se donde ponerlo. Como le digo al if que cargue el archivo que apenas se adjuntará

Por Troymustang

7 de clabLevel



Genero:Masculino  

safari

 

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