Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/03/2013, 07:31
Avatar de tuclavador
tuclavador
 
Fecha de Ingreso: abril-2012
Mensajes: 25
Antigüedad: 12 años
Puntos: 0
Formulario vacio automaticamente

Hola sucede que hace algunos dias empezaron a llegarme de mi web formularios vacios, inclui la sentencia STRIM para evitar que sigan llegando formularios vacios y el problema continua "ojo" que mi programacion funciona!! cuando me envío mensajes de prueba me llegan perfectamente!!, son solo algunos formularios que me llegan vacios, revise la programacion de la validacion php y el formulario html y no encontré errores, mi pregunta es que si existe alguna forma de que lleguen formularios vacios automaticamente o a que se debe este error ?
es del servidor? mi codigo? o algun tipo de virus?
De ante mano muchas gracias por su tiempo!!

codigo php:

<?php

/*trim funcion que quita espacios del incio y final*/
$nombre = trim($_POST['nombre']);
$fecha = trim($_POST['fecha']);
$email = trim($_POST['email']);
$telefono = trim($_POST['telefono']);
$comentarios = trim($_POST['comentarios']);
$Hora= date('H:i:s');

/* $header = 'From: ' . $mail . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
*/
// $mensaje = "Este mensaje fue enviado por " . $nombre . ", de la empresa " . $empresa . " \r\n";
$mensaje .= "------------------------------------------------------- \n";
$mensaje .= " ******* NUEVO CONTACTO DESDE marcas.com.bo ******* \r\n";
$mensaje .= "------------------------------------------------------- \n";
$mensaje .= "Nombre del remitente: " . $nombre . " \r\n";
/*$mensaje .= "Fecha: " . $fecha . " \r\n";*/
$mensaje .= "Email: " . $email . " \r\n";
$mensaje .= "Telefono: " . $telefono . " \r\n";
$mensaje .= "Enviado el " . date('d/m/Y', time());
$mensaje .= " - " . $Hora . " \r\n";
$mensaje .= "------------------------------------------------------- \n";
$mensaje .= "Comentarios: " . $comentarios . " \r\n";
$mensaje .= "------------------------------------------------------- \n";
//$mensaje .= "Comentario: " . $_POST['comentario'] . " \r\n";


$para = '[email protected]';
$asunto = 'Formulario Marcas';

mail($para, $asunto, utf8_decode($mensaje));

echo 'Gracias por escribirnos';
?>

<script type="text/javascript">
alert('Felicidades sus mensaje ha sido enviado');

var pagina="contactos.html"
function redireccionar()
{
location.href=pagina
}
setTimeout ("redireccionar()", 0);

</script>
-------------------------------------------------------------------------------------

codigo html:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-AU">
<head>
<title>MARCAS - COCHABAMBA | BOLIVIA</title>
<link rel="shortcut icon" href="icono.ico"/>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style_cont.css" />
<script>
function validar(form1)
{

if(document.form1.nombre.value.trim() == "" || document.form1.email.value.trim() == "" || document.form1.telefono.value.trim() == "" || document.form1.comentarios.value.trim() == "")
{
alert("Llene todos los campos por favor");
return false;
}
else{}
return true;

}
</script>

</head>

<body>

<div id="div_form">
<form id="form1" name="form1" action="validar.php" method="post" onsubmit="return validar()">
<br />
<table width="558" border="0" height="204">
<tr>
<td width="131">Ingrese su Nombre: </td>
<td width="417"><input type="string" name="nombre" size="28" maxlength="60">
</td>
</tr>

<tr>
<td>Ingrese su Email:</td>
<td><input type="string" name="email" size="28" maxlength="100" value=""></td>
</tr>

<tr>
<td>Tel&eacute;fono o Celular:</td>
<td><input type="string" name="telefono" size="28" maxlength="100" ></td>
</tr>

<tr>
<td align="left" >Consultas:</td>
<td><textarea cols="25" rows="4" name="comentarios"></textarea></td>
</tr>

<tr align="center">
<td align="left">&nbsp;</td>
<td><input type="submit" name="boton" value="Enviar">&nbsp;&nbsp;&nbsp;
<input type="Reset" name="limpiar"value="Limpiar"></td>

</table>
</form>

</script>
</body>
</html>