Foros del Web » Programando para Internet » PHP »

Formulario php

Estas en el tema de Formulario php en el foro de PHP en Foros del Web. HOLA ESTOY HACIENDO UNA WEB CON UN FORMULARIO CON VALIDACION Y UN ARCHIVO PHP PARA ENVIAR EL RESULTADO DEL FORMAULARIO A UN EMAIL. TODO VA ...
  #1 (permalink)  
Antiguo 22/02/2013, 15:41
 
Fecha de Ingreso: noviembre-2010
Mensajes: 48
Antigüedad: 13 años, 5 meses
Puntos: 1
Formulario php

HOLA ESTOY HACIENDO UNA WEB CON UN FORMULARIO CON VALIDACION Y UN ARCHIVO PHP PARA ENVIAR EL RESULTADO DEL FORMAULARIO A UN EMAIL.
TODO VA BIEN EL FORMULARIO ANDA PERFECTO LA VALIDACION TAMBIEN Y SE ENVIAN LOS EMAILS. EL UNICO TEMA ES QUE EN LOS EMAILS NO ME LLEGA LA INFORMACION QUE INGRESA LA PERSONA QUE LLENA EL FORMULARIO (LLEGAN LOS EMAILS PERFECTOS PERO FALTA LA INFORMACION QUE INGRESA EL VISITANTE).
MUCHO NO SE DE PHP. PERO ME PARECE QUE HAY ALGO QUE NO COINCIDE ENTRE EL FORMULARIO Y EL PHP PARA EL ENVIO.

LES ENVIO EL CODIGO DEL FORMULARIO QUE ESTA EN EL HTML:

<form action="php/quickcontact.php" method="post" id="contactwidget">
<div class="inp_l">
<div class="inp_r"><input type="text" name="wname" id="wname" value="Nombre" size="22" tabindex="11" alt="Nombre" /></div>
</div>

<div class="inp_l">
<div class="inp_r"><input type="text" name="wemail" id="wemail" value="Email" size="22" tabindex="12" alt="Email" /></div>
</div>
<table>
<tr>
<td class="text_t_l"></td>
<td class="text_t"></td>
<td class="text_t_r"></td>
</tr>
<tr>
<td class="text_l"></td>
<td class="text_m"><textarea name="wmessage" id="wmessage" cols="28" rows="6" tabindex="13" title="Mensaje">Mensaje</textarea></td>
<td class="text_r"></td>
</tr>
<tr>
<td class="text_b_l"></td>
<td class="text_b"></td>
<td class="text_b_r"></td>
</tr>
</table>
<div class="loading"></div>
<div><input type="hidden" name="wcontactemail" id="wcontactemail" value="[email protected]" /></div>
<div><input type="hidden" name="wcontacturl" id="wcontacturl" value="php/quickcontact.php" /></div>
<div><a href="php/quickcontact.php" id="wformsend" class="button" tabindex="14"><span>Enviar</span></a></div>
</form>


Y EL DEL ARCHIVO PHP DE ENVIO:

<?php
if ((isset($_POST['wname'])) && (strlen(trim($_POST['wname'])) > 0)) {
$contact_name = stripslashes(strip_tags($_POST['wname']));
} else {$contact_name = 'No contact name entered';}
if ((isset($_POST['wemail'])) && (strlen(trim($_POST['wemail'])) > 0)) {
$contact_email = stripslashes(strip_tags($_POST['wemail']));
} else {$contact_email = 'No email entered';}
if ((isset($_POST['wmessage'])) && (strlen(trim($_POST['wmessage'])) > 0)) {
$contact_message = stripslashes(strip_tags($_POST['wmessage']));
} else {$contact_message = 'No message entered';}
ob_start();
?>
<html>
<head>
<style type="text/css">
</style>
</head>
<body>
<table width="550" border="1" cellspacing="2" cellpadding="2">
<tr bgcolor="#eeffee">
<td>Name</td>
<td><?=$wname;?></td>
</tr>
<tr bgcolor="#eeeeff">
<td>Email</td>
<td><?=$wemail;?></td>
</tr>
<tr bgcolor="#eeeeff">
<td>Message</td>
<td><?=$wmessage;?></td>
</tr>
</table>
</body>
</html>
<?
$body = ob_get_contents();

$to = '[email protected]';
$email = '[email protected]';
$fromaddress = "[email protected]";
$fromname = "Online Contact";

require("phpmailer.php");

$mail = new PHPMailer();

$mail->From = "[email protected]";
$mail->FromName = "Contacto";
$mail->AddAddress("[email protected]","Pablo"); //change to your email address

$mail->WordWrap = 50;
$mail->IsHTML(true);

$mail->Subject = "Quickcontact: Mensaje recibido";
$mail->Body = $body;
$mail->AltBody = "This is the text-only body";

if(!$mail->Send()) {
$recipient = '[email protected]'; //change to your email address
$subject = 'contactwidget failed';
$content = $body;
mail($recipient, $subject, $content, "From: [email protected]\r\nReply-To: $email\r\nX-Mailer: DT_formmail");
exit;
}
?>

SI ME PUEDEN AYUDAR LES ESTARIA MUY AGRADECIDO.
  #2 (permalink)  
Antiguo 22/02/2013, 15:45
Avatar de jotaincubus  
Fecha de Ingreso: mayo-2005
Ubicación: Medellin - Colombia
Mensajes: 1.797
Antigüedad: 19 años
Puntos: 394
Respuesta: Formulario php

Código HTML:
Ver original
  1. <a href="php/quickcontact.php" id="wformsend" class="button" tabindex="14"><span>Enviar</span></a>

Esto jamas sera un boton valido para el envido de datos por POST de un formulario a no ser que use JavaScript

Haga la prueba con un type="submit" para ver si le funciona
__________________
Por que existe gente que no agradece después de que se le ha brindado tiempo y ayuda ???
  #3 (permalink)  
Antiguo 22/02/2013, 17:36
 
Fecha de Ingreso: noviembre-2010
Mensajes: 48
Antigüedad: 13 años, 5 meses
Puntos: 1
Respuesta: Formulario php

EL FORMULARIO SE ENVIA PERFECTO LLEGA EL EMAIL PERFECTO. TAMBIEN LLEGA EN EL CUERPO DEL MENSAJE LA TABLA ESPECIFICADA EN EL ARCHIVO PHP PERO EN ESTA TABLA NO SE VEN LOS DATOS QUE ESCRIBE EL VISITANTE. ES DECIR EN EL MENSAJJE RECIBIDO SE VE:

Name:
Email:
Message:

PERO NO SE CARGAN LOS DATOS INGRESADOS AL LLENAR EL FORMULARIO. SUPINGO QUE DEBE HABER UN ERROR DE RELACION ENTRE LAS ETIQUETAS DEL FORMULARIO Y LAS DEL ARCHIVO PHP.

Etiquetas: formularios
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 07:40.