Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/05/2007, 14:05
Avatar de franklin85
franklin85
 
Fecha de Ingreso: octubre-2006
Mensajes: 103
Antigüedad: 17 años, 6 meses
Puntos: 0
sistema de postales con base de datos

Hola a todos my problema es el siguiente:
Tengo los archivos postales.php
Código PHP:
<a href="envio.php?id=1"><img src="jpg/amistad-01.jpg" width="160" height="100" border="0" style="border-style: outset; border-color: #999999; border-width:2px;"></a>
<
a href="envio.php?id=2"><img src="jpg/amistad-02.jpg" width="160" height="100" border="0" style="border-style: outset; border-color: #999999; border-width:2px;"></a>
<
a href="envio.php?id=3"><img src="jpg/amistad-03.jpg" width="160" height="100" border="0" style="border-style: outset; border-color: #999999; border-width:2px;"></a
y tambien tengo el archivo envio.php
Código PHP:
<?
if (isset($HTTP_SERVER_VARS['QUERY_STRING_UNESCAPED']))
    {
    list(
$uri,$ssi_vars) = explode("?",$HTTP_SERVER_VARS['REQUEST_URI']);
    
$ssi_vars explode("&",$ssi_vars);
    for (
$i=0$i<sizeof($ssi_vars); $i++)
        {
        list(
$name$value) = explode("=",$ssi_vars[$i]);
        $
$name=$value;
        }
    }


include(
"../conexion.php");
$sql="select imagen1, imagen2 from postales where idpostal=$id and flg_activo='1'";

$iqryvar=mysql_query($sql,$ilink);
while (
$row mysql_fetch_array($iqryvar)) {
$imagen1=$row["imagen1"];
$imagen2=$row["imagen2"];
}
echo 
"<img src='postales/$imagen2' border=0 style='border: medium double #f0f0ee'>";
echo 
"<input type=hidden name=id value=$id >";
?>

<form name="m" method="post" action="procesa.php" style="margin:0px,">
    <p id="postales3">De:</p>&nbsp;<input type="text" name="remite" value="">
    <p id="postales3">Para:</p>&nbsp;<input type="text" name="destino" value="">
    <p id="postales3">E-mail de Remitente:</p>&nbsp;<input type="text" name="emailremite" value="">
    <p id="postales3">E-mail de Destinatario:</p>&nbsp;<input type="text" name="emaildestino"  value="">
    <p id="postales3">Saludo:</p><textarea name="mensaje" cols=40 rows=3></textarea>
    <input type="button" value="Enviar" onClick="validar()" name="button">&nbsp;<input type="reset" value="Cancelar" name="reset">
</form>
este archivo (envio.php) llama al archivo procesa.php
Código PHP:
<?php
include("../conexion.php");
$sql="select * from postales where idpostal='$id' and flg_activo='1'";
$iqryvar=mysql_query($sql,$ilink);
while (
$row mysql_fetch_array($iqryvar))
{
$imagen=$row[3];
}

 echo 
"<div align=center><font face=arial size=2 color=ffffff><b>".$remite."</b><br>Felicitaciones<br> Se ha enviado a tu amigo(a) la Postal<br></div>";

/* mensaje */
$mensaje "
<font face=Arial size=2 color=ffffff>Esta postal ha sido enviada por:<br><b>$remite</b></font>
<img src='http://www.xxx.com.pe/postales/postales/"
.$imagen."' border=0 style='border: medium double #f0f0ee'>
<font face=Arial size=2 color=ffffff>Mensaje:</font>
<font face=Arial size=2 color=ffffff><b>$mensaje</b></font>
"
;

//Envio de Correo a Amigo
$emailenviado=mail("$emaildestino","Tu Amigo(a) $remite te ha enviado una Postal",$mensaje,"From: [email protected]\r\nContent-type: text/html;\nX-Mailer:PHP/"'-f $mail');
mysql_close($ilink);
?>
el cual se supone que envia la postal, e ahy el problema cuando envio la postal al destinatario le llega todo menos la imagen, pero cuando el archivo procesa.php se esta ejecutando no me muestra ningun error.
Aqui les dejo como esta estructurado mi bd.
Código PHP:
CREATE TABLE `postales` (
  `
idpostalint(11NOT NULL auto_increment,
  `
nombrevarchar(80) default NULL,
  `
imagen1varchar(30) default NULL,
  `
imagen2varchar(30) default NULL,
  `
flg_activochar(1) default NULL,
  
PRIMARY KEY  (`idpostal`)
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=;


INSERT INTO `postalesVALUES (1'amistad 1''amistad-01.jpg''amistad-01.gif''1');
INSERT INTO `postalesVALUES (2'amistad 2''amistad-02.jpg''amistad-02.gif''1');
INSERT INTO `postalesVALUES (3'amistad 3''amistad-03.jpg''amistad-03.gif''1'); 
Ojo.- imagen1 es la imagen en mimiatura de la postal, e imagen2 es la imagen es la postal en formato gif.

Bueno en definitiva el problema esta en que no llega la imagen que yo selecciono en la pagina postales.php pero si llega el mensaje y el remitente.
Que solución me dan a todo esto.
Gracias de antemano.