Ver Mensaje Individual
  #4 (permalink)  
Antiguo 31/03/2007, 02:27
moquehua
 
Fecha de Ingreso: agosto-2004
Mensajes: 113
Antigüedad: 19 años, 8 meses
Puntos: 0
Re: formMail en la una misma pagina (2)

hola, gracias por las dos respuestas!
estuve probando y logre que no salga ningun error (por lo menos visible).
El php quedo asi
Código PHP:
<?php /*empieza formulario*/
if($Enviar){@$Nombre $_POST['Nombre'];
@
$Email $_POST['Email'];
@
$Consulta $_POST['Consulta'];
@
$clid $_POST['clid'];

mysql_query("update clientes set consultas=consultas+1 where clid='$clid'");


$result mysql_query("select vid from visitantes where mail = '$Email'");
$results mysql_num_rows($result);
if (
$results>0) {
        
mysql_query("update visitantes set contactos=contactos+1 where mail='$Email'");
    } else {
        
mysql_query("insert into visitantes values (NULL, '$Nombre', '$Email', 1)");
}

$result mysql_query("select mail, cliente from clientes where clid = '$clid'");
list(
$receptor) = mysql_fetch_array($result);

$header "From: $Nombre <$Email>\n";
$header .= "To: ".$receptor."\n";
$header .= "X-Mailer: PHP4\n"//mailer
$header .= "MIME-Version: 1.0\n";
$header .= "Reply-to: ".$Email."\n";
$header .= "Content-type: text/html; charset=iso-8859-1\n";
//************************************************************************/


$cuerpo "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html><head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>

</head>
<body>
     <tr>
    <td bgcolor='#fea941' align='left' valign='top'>" 
$Nombre " env&iacute;a una consulta desde misitio.com.ar
    <br>Nombre: " 
$Nombre "
    <br><a href='mailto: " 
$Email "'> " $Email "</a>
    <br>Consulta: " 
$Consulta "    
    </td></tr></body></html>"
;

mail($receptor,'Visitante de misitio.com.ar',$cuerpo,$header);

}
else{ 
//se manda// ?>    
<form action="ver.php?clid=<? echo $clid?>&amp;cliente=<? echo $cliente?>" method="post" name="form1" target="_self" onSubmit="MM_validateForm('Nombre','','R','Email','','RisEmail','consulta','','R');return document.MM_returnValue">
                    <table width="383" height="250" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                  <td align="left" valign="top">
<table width="383" height="20" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FEA941">
                            <tr>
                                                      <td align="left" valign="middle" bgcolor="#FEA941" class="fecha">Enviar 
                                                        una consulta a<strong>&nbsp;<?php echo $cliente?></strong></td>
                      </tr>
                    </table>
                          <table width="360" height="0" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr>
                        <td width="271" align="left" valign="top" class="texto2"><input name="clid" type="hidden" value="<?php echo $clid?>"> 
                        </td>
                      </tr>
                    </table>
                          <table width="360" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td align="left" valign="middle" class="opcion">Nombre<br>
                          <input name="Nombre" type="text" id="Nombre2" size="40" style="width:360px" class="formularios"></td>
                      </tr>
                    </table>
                          <table width="360" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td width="240" align="left" valign="middle" class="opcion">E-mail<br>
                          <input name="Email" type="text" id="Email2" size="40" style="width:360px" class="formularios"></td>
                      </tr>
                    </table>
                          <table width="360" height="60" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                              <td align="left" valign="middle" class="opcion">Consulta<br>
                          <textarea name="Consulta" cols="40" rows="5" id="textarea" style="width:360px" class="formularios"></textarea></td>
                      </tr>
                    </table>
                          <table width="360" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> 
                        <td><input type="submit" name="Submit" value="Enviar" class="bt-form"> 
                          <input type="reset" name="Submit2" value="Borrar" class="bt-form"></td>
                      </tr>
                    </table></td>
                </tr>
              </table>
            </form><? }
//fin del formulario//?>
donde aparentemente (digo aparentemente porque un error tiene que haber) no hay errores, pero el correo no se envia.
No estoy muy seguro con esta linea
Código PHP:
$result mysql_query("select mail, cliente from clientes where clid = '$clid'");
list(
$receptor) = mysql_fetch_array($result); 
me parece que deberia ser
Código PHP:
$result mysql_query("select mail from clientes where clid = '$clid'");
list(
$receptor) = mysql_fetch_array($result); 
o asi
Código PHP:
$result mysql_query("select mail, cliente from clientes where clid = '$clid'");
list(
$receptor$receptor1) = mysql_fetch_array($result); 
o sino asi
Código PHP:
$result mysql_query("select mail from clientes where clid = '$clid'");
list(
$receptor) = mysql_fetch_array($result);
$result2 mysql_query("select cliente from clientes where clid = '$clid'");
list2($receptor1) = mysql_fetch_array($result2); 
Estoy muy errado? me estoy complicando demasiado?
saludos