Foros del Web » Programando para Internet » Jquery »

Formulario no envia variables

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

HOLA ESTOY HACIENDO UNA WEB CON UN FORMULARIO Y UN ARCHIVO PHP PARA ENVIAR EL RESULTADO DEL FORMULARIO 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 LLEGA LA INFORMACION QUE INGRESA LA PERSONA QUE LLENA EL FORMULARIO (LLEGAN LOS EMAILS PERO FALTA LA INFORMACION QUE INGRESA EL VISITANTE).

EL CODIGO DEL FORMULARIO QUE ESTA EN EL HTML ES:

<div class="widget widget_custom_contact_form_entries">
<div class="one_fourth">
<h3>Contáctenos</h3>
<div class="widgeterror">Su mensaje no pudo ser enviado<br />Los datos ingresados son erróneos o están incompletos!</div>
<div class="widgetinfo">Gracias! <br />Su mensaje ha sido enviado. Nos comunicaremos con usted a la brevedad</div>
<div class="form">
<form action="php/enviar2.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/enviar2.php" /></div>

<div><a href="#" id="wformsend" class="button" tabindex="14"><span>Enviar</span></a></div>
</form>

************************************************** ***************

EL PHP DE ENVIO ES:

<?php
$wname = $_POST["wname"];
$wemail = $_POST["wemail"];
$wmessage = $_POST["wmessage"];
$wcontactemail = $_POST["wcontactemail"];
$wcontacturl = $_POST["wcontacturl"];

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>titulo</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<table width="550" border="1" cellspacing="2" cellpadding="2">
<tr bgcolor="#eeffee">
<td>Name</td>
<td><?php echo $wname; ?></td>
</tr>
<tr bgcolor="#eeeeff">
<td>Email</td>
<td><?=$wemail; ?></td>
</tr>
<tr bgcolor="#eeeeff">
<td>Message</td>
<td><?=$wmessage;?></td>
</tr>
<tr bgcolor="#eeeeff">
<td>Contactemail</td>
<td><?=$wcontactemail;?></td>
</tr>
<tr bgcolor="#eeeeff">
<td>Contacturl</td>
<td><?=$wcontacturl;?></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 = "Intelprox - Contacto";
$mail->AddAddress("EMAIL DE RECEPCION","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 DE RECEPCION'; //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;
}
?>

************************************************** *********

DESDE YA MUCHAS GRACIAS
  #2 (permalink)  
Antiguo 24/02/2013, 15:52
 
Fecha de Ingreso: noviembre-2010
Mensajes: 48
Antigüedad: 13 años, 4 meses
Puntos: 1
Respuesta: Formulario no envia variables

PARTE DEL JAVASCRIPT (SCRIPT.JS) DONDE FIGURA EL VALIDADOR (PARA LOS FORMULARIOS DEL SITIO SON 2 EN TOTAL)

................................


jQuery('#contactwidget input#wname').each(function(i){
jQuery(this).focus(function(){
if (jQuery(this).val() == 'Nombre'){
jQuery(this).val('');
}
});
jQuery(this).blur(function(){
if (jQuery(this).val() == '' || jQuery(this).val() == ' '){
jQuery(this).val('Nombre');
}
});
}); //Contact Widget Name

jQuery('#contactwidget input#wemail').each(function(i){
jQuery(this).focus(function(){
if (jQuery(this).val() == 'Email'){
jQuery(this).val('');
}
});
jQuery(this).blur(function(){
if (jQuery(this).val() == '' || jQuery(this).val() == ' '){
jQuery(this).val('Email');
}
});
}); //Contact Widget Email

jQuery('#contactwidget textarea#wmessage').each(function(i){
jQuery(this).focus(function(){
if (jQuery(this).val() == 'Mensaje'){
jQuery(this).val('');
}
});
jQuery(this).blur(function(){
if (jQuery(this).val() == '' || jQuery(this).val() == ' '){
jQuery(this).val('Mensaje');
}
});
}); //Contact Widget Message
jQuery('#middle .post:last').css({background:'none', margin:0}); //Last Post Fixes
if (jQuery('#middle .related_posts').next().attr('id') != 'comments'){
jQuery('#middle .related_posts').css({background:'none'});
} //Last Post Fixes
});

.................................................. ..........


/* Form */
function submitform() {
document.forms['commentform'].submit();
return false;
};



/* Contact Form */
function checkemail(emailaddress){
var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
return pattern.test(emailaddress);
}

jQuery(document).ready(function(){
jQuery('#contactform a#formsend').click(function(){
var $name = jQuery('#name').val();
var $email = jQuery('#email').val();
var $subject = jQuery('#subject').val();
var $url = jQuery('#url').val();
var $message = jQuery('#message').val();
var $contactemail = jQuery('#contactemail').val();
var $contacturl = jQuery('#contacturl').val();
if ($name != '' && $name.length < 3){ $nameshort = true; } else { $nameshort = false; }
if ($name != '' && $name.length > 30){ $namelong = true; } else { $namelong = false; }
if ($email != '' && checkemail($email)){ $emailerror = true; } else { $emailerror = false; }
if ($subject != '' && $subject.length < 3){ $subjectshort = true; } else { $subjectshort = false; }
if ($subject != '' && $subject.length > 100){ $subjectlong = true; } else { $subjectlong = false; }
if ($url == ''){ $url = 'none'; }
if ($message != '' && $message.length < 3){ $messageshort = true; } else { $messageshort = false; }
jQuery('#contactform .loading').animate({opacity: 1}, 250);
if ($name != '' && $nameshort != true && $namelong != true && $email != '' && $emailerror != false && $subject != '' && $subjectshort != true && $subjectlong != true && $message != '' && $messageshort != true && $contactemail != '' && $contacturl != ''){
jQuery.post($contacturl,
{contactemail: $contactemail, name: $name, email: $email, subject: $subject, website: $url, message: $message},
function(data){
jQuery('#contactform .loading').animate({opacity: 0}, 250);
jQuery('.entry div.contform').fadeOut('slow');
jQuery('#name, #subject, #url, #email, #message').val('');
jQuery('#contactform div.form_info div.form_error').hide();
jQuery('.entry .box').hide();
jQuery('.entry .info_box').fadeIn('fast');
jQuery('html, body').animate({scrollTop:750}, 'slow');
jQuery('.entry .info_box').delay(5000).fadeOut(1000, function(){
jQuery('.entry div.contform').fadeIn('slow');
});
}
);
return false;
} else {
jQuery('#contactform .loading').animate({opacity: 0}, 250);
jQuery('.entry .box').hide();
jQuery('.entry .error_box').fadeIn('fast');
jQuery('html, body').animate({scrollTop:750}, 'slow');
jQuery('.entry .error_box').delay(5000).fadeOut('slow');
if ($name == ''){
jQuery('#name').parent().parent().parent().find('d iv.form_error').hide();
jQuery('#name').parent().parent().parent().find('d iv.defaulterror').show();
} else if ($nameshort == true){
jQuery('#name').parent().parent().parent().find('d iv.form_error').hide();
jQuery('#name').parent().parent().parent().find('d iv.shorterror').show();
} else if ($namelong == true){
jQuery('#name').parent().parent().parent().find('d iv.form_error').hide();
jQuery('#name').parent().parent().parent().find('d iv.longerror').show();
} else {
jQuery('#name').parent().parent().parent().find('d iv.form_error').hide();
}
if ($email == ''){
jQuery('#email').parent().parent().parent().find(' div.form_error').hide();
jQuery('#email').parent().parent().parent().find(' div.defaulterror').show();
} else if ($emailerror == false){
jQuery('#email').parent().parent().parent().find(' div.form_error').hide();
jQuery('#email').parent().parent().parent().find(' div.invaliderror').show();
} else {
jQuery('#email').parent().parent().parent().find(' div.form_error').hide();
}
if ($subject == ''){
jQuery('#subject').parent().parent().parent().find ('div.form_error').hide();
jQuery('#subject').parent().parent().parent().find ('div.defaulterror').show();
} else if ($subjectshort == true){
jQuery('#subject').parent().parent().parent().find ('div.form_error').hide();
jQuery('#subject').parent().parent().parent().find ('div.shorterror').show();
} else if ($subjectlong == true){
jQuery('#subject').parent().parent().parent().find ('div.form_error').hide();
jQuery('#subject').parent().parent().parent().find ('div.longerror').show();
} else {
jQuery('#subject').parent().parent().parent().find ('div.form_error').hide();
}
if ($message == ''){
jQuery('#message').parent().parent().parent().pare nt().parent().find('div.form_error').hide();
jQuery('#message').parent().parent().parent().pare nt().parent().find('div.defaulterror').show();
} else if ($messageshort == true){
jQuery('#message').parent().parent().parent().pare nt().parent().find('div.form_error').hide();
jQuery('#message').parent().parent().parent().pare nt().parent().find('div.shorterror').show();
} else {
jQuery('#message').parent().parent().parent().pare nt().parent().find('div.form_error').hide();
}
return false;
}
});
});

jQuery(document).ready(function(){
jQuery('#contactwidget a#wformsend').click(function(){
var $name = jQuery('#wname').val();
var $email = jQuery('#wemail').val();
var $message = jQuery('#wmessage').val();
var $contactemail = jQuery('#wcontactemail').val();
var $contacturl = jQuery('#wcontacturl').val();
if ($name != '' && $name.length < 3){ $nameshort = true; } else { $nameshort = false; }
if ($name != '' && $name.length > 30){ $namelong = true; } else { $namelong = false; }
if ($email != '' && checkemail($email)){ $emailerror = true; } else { $emailerror = false; }
if ($message != '' && $message.length < 3){ $messageshort = true; } else { $messageshort = false; }
jQuery('#contactwidget .loading').animate({opacity: 1}, 250);
if ($name != '' && $nameshort != true && $namelong != true && $email != '' && $emailerror != false && $message != '' && $messageshort != true && $contactemail != '' && $contacturl != ''){
jQuery.post($contacturl,
{contactemail: $contactemail, name: $name, email: $email, message: $message},
function(data){
jQuery('#contactwidget .loading').animate({opacity: 0}, 250);
jQuery('.form').fadeOut();
jQuery('#bottom #wname, #bottom #wemail, #bottom #wmessage').css({'border-bottom':'0'});
jQuery('.widgeterror').hide();
jQuery('.widgetinfo').fadeIn('slow');
jQuery('.widgetinfo').delay(5000).fadeOut(1000, function(){
jQuery('#wname').val(jQuery('#wname').attr('alt')) ;
jQuery('#wemail').val(jQuery('#wemail').attr('alt' ));
jQuery('#wmessage').val(jQuery('#wmessage').attr(' title'));
jQuery('.form').fadeIn('slow');
});
}
);
return false;
} else {
jQuery('#contactwidget .loading').animate({opacity: 0}, 250);
jQuery('.widgeterror').hide();
jQuery('.widgeterror').fadeIn('fast');
jQuery('.widgeterror').delay(5000).fadeOut(1000);
if ($name == '' || $nameshort == true || $namelong == true){
jQuery('#wname').css({'border-bottom':'1px solid #dd2200'});
} else {
jQuery('#bottom #wname').css({'border-bottom':'0'});
}
if ($email == '' || $emailerror == false){
jQuery('#wemail').css({'border-bottom':'1px solid #dd2200'});
} else {
jQuery('#bottom #wemail').css({'border-bottom':'0'});
}
if ($message == '' || $messageshort == true){
jQuery('#wmessage').css({'border-bottom':'1px solid #dd2200'});
} else {
jQuery('#bottom #wmessage').css({'border-bottom':'0'});
}
return false;
}
});
});
Editar/Borrar Mensaje
  #3 (permalink)  
Antiguo 24/02/2013, 16:09
Avatar de caricatos
Moderador
 
Fecha de Ingreso: abril-2002
Ubicación: Torremolinos (Málaga)
Mensajes: 19.607
Antigüedad: 22 años
Puntos: 1284
Respuesta: Formulario no envia variables

Hola:

No es necesario invadir todos los foros con tu consulta... A primera vista te falta un botón submit... luego, al tratarse de jquery, hemos movido el tema a ese foro...

Saludos
__________________
Por favor:
No hagan preguntas de temas de foros en mensajes privados... no las respondo
  #4 (permalink)  
Antiguo 24/02/2013, 16:17
 
Fecha de Ingreso: noviembre-2010
Mensajes: 48
Antigüedad: 13 años, 4 meses
Puntos: 1
Respuesta: Formulario no envia variables

Perdon pero no sabia bien donde incluir el tema
  #5 (permalink)  
Antiguo 24/02/2013, 16:23
Avatar de emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 9 meses
Puntos: 1567
Respuesta: Formulario no envia variables

Por que no te esforzás en terminar de hacer esto como corresponde
http://www.forosdelweb.com/f2/formul...8/#post4376353
en lugar de sumergirte en un mar de código del cual, a esta altura, es evidente no tenés la menor idea de lo que hace

:
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.

Etiquetas: formulario, javascript, php+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.
Tema Cerrado




La zona horaria es GMT -6. Ahora son las 18:09.