Foros del Web » Programando para Internet » PHP »

Problemas Mail Form.. Datos incompletos!!!

Estas en el tema de Problemas Mail Form.. Datos incompletos!!! en el foro de PHP en Foros del Web. Saludos tngo un problema... hice un mail form y envia sin error alguno pero al enviar el mail los datos no llegan... llega algo asi ...
  #1 (permalink)  
Antiguo 12/09/2007, 08:05
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 7 meses
Puntos: 28
Problemas Mail Form.. Datos incompletos!!!

Saludos tngo un problema... hice un mail form y envia sin error alguno pero al enviar el mail los datos no llegan... llega algo asi
Este comentario ha sido enviado desde www.basinger.com.ve

Comentario enviado por:



Nombre:

Correo Electronico:

Telefono:

Direccion:

Comentario:

pero fijense q esta en blanco... o sea llega vacio.. no envia los campos.. reviso y reviso y sigue lo mismo... alguien podria ayudarme en este caso????... aqui les dejo el codigo!!!
Código:
 <?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

$para      = "[email protected]";
$asunto    = 'Basinger de Venezuela, C.A.';

//*** Aca el cuerpo del Mensaje
$mensaje= "<html><head><title>Comentario de Contactenos</title></head><body><br><br>
<font size=5 font=arial>Este comentario ha sido enviado desde www.basinger.com.ve <br><br>Comentario enviado por: </font><br><br>";
$mensaje = $mensaje."<br><br>Nombre:&nbsp;&nbsp;".$nombre; 
$mensaje = $mensaje."<br><br>Correo Electronico:&nbsp;&nbsp;<a href='mailto:".$correo."'>".  $correo     ."</a>"; 
$mensaje = $mensaje."<br><br>Telefono:&nbsp;&nbsp;".$telefono;
$mensaje = $mensaje."<br><br>Direccion:&nbsp;&nbsp;".$direccion; 
$mensaje = $mensaje."<br><br>Comentario:&nbsp;&nbsp;".$comentario; 
$mensaje = $mensaje."<br><br></body></html>";

//***************************************************************
$cabeceras =  'From:'. $correo . "\r\n";
$cabeceras .= 'Reply-To: [email protected]' . "\r\n";
$cabeceras .= "Content-type: text/html; charset=iso-8859-1\n";
mail($para, $asunto, $mensaje, $cabeceras);
//***********************************************************************

  $insertGoTo = "final.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}


?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../css/estilo.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}
//-->
</script>
<link href="css/ccs-txt.css" rel="stylesheet" type="text/css">
<link href="css/estilo.css" rel="stylesheet" type="text/css">
<link href="estilos.css" rel="stylesheet" type="text/css">
</head>

<body>
<form action="form.php" method="post" name="form1" onSubmit="MM_validateForm('nombre','','R','correo','','RisEmail','telefono','','NisNum');return document.MM_returnValue">
  <table align="center">
    <tr valign="baseline">
      <td align="right" nowrap class="verdana_once">*Nombre:</td>
      <td width="170" class="verdana_once"><input name="nombre" type="text" id="nombre" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D" onBlur="MM_validateForm('nombre','','R');return document.MM_returnValue" value="" size="34"></td>
    </tr>
    <tr valign="baseline">
      <td align="right" nowrap class="verdana_once">*E-Mail:</td>
      <td class="verdana_once"><input name="correo" type="text" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D" onBlur="MM_validateForm('nombre','','RisEmail');return document.MM_returnValue" value="" size="34"></td>
    </tr>
    <tr valign="baseline">
      <td align="right" nowrap class="verdana_once">Tel&eacute;fono:</td>
      <td class="verdana_once"><input type="text" name="telefono" value="" size="34" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D"></td>
    </tr>
    <tr valign="baseline">
      <td align="right" nowrap class="verdana_once">Empresa: </td>
      <td class="verdana_once"><input type="text" name="direccion" value="" size="34" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D"></td>
    </tr>
    <tr valign="baseline">
      <td align="right" valign="top" nowrap class="verdana_once">*Comentarios</td>
      <td class="verdana_once">
      <textarea name="comentario" cols="31" rows="5" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D"></textarea>      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap align="right">&nbsp;</td>
      <td class="verdana_once"><div align="right">
        <input type="submit" class="verdana11" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: bold; border: 1px solid #7a7864" value="Enviar">
      </div></td>
    </tr>
  </table>
  <p class="texto-normal">
    <input type="hidden" name="MM_insert" value="form1">
  </p>
</form>
</body>
</html>
saludos y de antemano gracias!!!!!
  #2 (permalink)  
Antiguo 12/09/2007, 08:28
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 10 meses
Puntos: 2135
Re: Problemas Mail Form.. Datos incompletos!!!

Cambia $nombre por $_POST['nombre'], y asi sucesivamente todos tus campos como $correo y $telefono.

Lo mas probable es que tengas desactivado register_globals, por lo que en lugar de usar la variable directamente tienes que usar $_POST['nombre_de_tu_variable'].

Saludos.
  #3 (permalink)  
Antiguo 12/09/2007, 08:32
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 7 meses
Puntos: 28
Re: Problemas Mail Form.. Datos incompletos!!!

ok dejame probar y t aviso... gracias!!!
  #4 (permalink)  
Antiguo 12/09/2007, 08:47
Avatar de T4ke0veR  
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 7 meses
Puntos: 28
Re: Problemas Mail Form.. Datos incompletos!!!

a la perfeccion.... gracias!!!!!
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:36.