Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/01/2011, 05:02
Avatar de DanoRox
DanoRox
 
Fecha de Ingreso: diciembre-2010
Ubicación: Maracay - Vzla
Mensajes: 19
Antigüedad: 13 años, 4 meses
Puntos: 2
Respuesta: Formulario RESPUESTA AUTOMATICA WRONG!

Abro php, lo cierro solo para poner el script de refresh, luego abro php otra ves coloco el else de lo datos incompletos, cierro php y VOILA...

Código HTML:
<!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" lang="en" xml:lang="en">
<head>

<meta name="autor" content="DanoRox" />
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<link rel="shortcut icon" href="favicon.ico" />
<title>DanoRox.::CONTACTO::.</title>
<link rel="stylesheet" href="dr.css" type="text/css" />
</head>
<body>
<div id="topi">
<object name="imFlash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width= "1010" height= "180" >
<param name="movie" value="flash/top.swf" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<!--[if !IE]> <-->
<object type="application/x-shockwave-flash" width="1010" height="180" data="flash/top.swf">
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
</object>
<!--> <![endif]-->
</object>
</div>
<!-- Navegacion -->
<div id="navi" class="box">
<a href="inicio.html"><img src="botones/inicio.png" alt="Inicio" class="btns" /></a> 
<a href="galeria.html"><img src="botones/galeria.png" alt="Galeria" class="btns" /></a> 
<a href="planes.html"><img src="botones/planes.png" alt="Planes" class="btns" /></a>
<a href="contacto.html"><img src="botones/contacto.png" alt="Contacto" class="btns" /></a>
</div>
<!-- Back -->
<p> </p>
<!-- Wrapers -->
<div id="box1" class="box">
<p><a href="galeria.html"><img src="botones/galeriar.png" alt="" title="" /></a></p>
<p>Algunos de nuestros productos:</p>
<p>Mug<img src="img/img1.png" alt="" title="" /></a></p>
<p>Gorras<img src="img/img2.png" alt="" title="" /></a></p>
<p>Digitalizado<img src="img/img3.png" alt="" title="" /></a></p>
<p>Bordados<img src="img/img4.png" alt="" title="" /></p>
</div>
<div id="box4" class="box">
<h1>CONTACTO</h1> 
<div align="center">
<?php
$nombre = $_POST['nombre'];
$mail = $_POST['mail'];
$ciudad = $_POST['ciudad'];
$telefono = $_POST['telefono'];
$comentario = $_POST['mensaje'];
$asunto = $_POST['asunto'];
$yo = '[email protected]';

    if(isset($nombre) && !empty($nombre) &&
    isset($mail) && !empty($mail) &&
    isset($ciudad) && !empty($ciudad) &&
    isset($telefono) && !empty($telefono) &&
    isset($comentario) && !empty($comentario)) {

$header = 'From: ' . $mail . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";

$header2 = 'From: ' . $yo . " \r\n";
$header2 .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header2 .= "Mime-Version: 1.0 \r\n";
$header2 .= "Content-Type: text/plain";

$mensaje = "Este mensaje fue enviado por " . $nombre . " \r\n";
$mensaje .= "De la ciudad de " . $ciudad . " \r\n";
$mensaje .= "Su numero es " . $telefono . " \r\n";
$mensaje .= "Su e-mail es: " . $mail . " \r\n";
$mensaje .= "Asunto: " . $asunto . " \r\n";
$mensaje .= "Mensaje: " . $comentario . " \r\n";
$mensaje .= "Enviado el " . date('d/m/Y', time());


$para = '[email protected]';
$asunto = $_POST['asunto'];
mail($para, $asunto, utf8_decode($mensaje), $header);
echo "<p> Mensaje enviado, tendras una respuesta lo mas pronto posible \n ";
?>
<script type="text/javascript">

var pagina = 'http://www.danorox.com/inicio.html';
var segundos = 90;

function redireccion() {

document.location.href=pagina;

}

setTimeout("redireccion()",segundos);

</script>
<?php
}else{ echo "<p>No has rellenado todos los campos</p>"; }
?>
</div>
</div>


<!-- Footer -->
<div id="footer">
<p><a href="contacto.html"><img src="img/cbd.gif" class="btns" alt="CreatedByDanoRox" /></a> <a href="http://validator.w3.org/check?uri=referer"><img class="btns" src="http://www.w3.org/Icons/valid-xhtml10" alt="XHTML 1.0 Strict Valido!" /></a> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" class="btns" alt="CSS Valido!" /></a></p>
</div>
</body>
</html> 
Y el fomulario es este:

Código HTML:
<!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" lang="en" xml:lang="en">
<head>
<meta name="autor" content="DanoRox" />
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<link rel="shortcut icon" href="favicon.ico" />
<title>DanoRox.::CONTACTO::.</title>
<link rel="stylesheet" href="dr.css" type="text/css" />
</head>
<body>
<div id="topi">
<object name="imFlash" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width= "1010" height= "180" >
<param name="movie" value="flash/top.swf" />
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<!--[if !IE]> <-->
<object type="application/x-shockwave-flash" width="1010" height="180" data="flash/top.swf">
<param name="menu" value="false" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
</object>
<!--> <![endif]-->
</object>
</div>
<!-- Navegacion -->
<div id="navi" class="box">
<a href="inicio.html"><img src="botones/inicio.png" alt="Inicio" class="btns" /></a> 
<a href="galeria.html"><img src="botones/galeria.png" alt="Galeria" class="btns" /></a> 
<a href="planes.html"><img src="botones/planes.png" alt="Planes" class="btns" /></a>
<a href="contacto.html"><img src="botones/contacto.png" alt="Contacto" class="btns" /></a>
</div>
<!-- Back -->
<p> </p>
<!-- Wrapers -->
<div id="box1" class="box">
<p><a href="galeria.html"><img src="botones/galeriar.png" alt="" title="" /></a></p>
<p>Algunos de nuestros productos:</p>
<p>Mug<img src="img/img1.png" alt="" title="" /></a></p>
<p>Gorras<img src="img/img2.png" alt="" title="" /></a></p>
<p>Digitalizado<img src="img/img3.png" alt="" title="" /></a></p>
<p>Bordados<img src="img/img4.png" alt="" title="" /></p>
</div>
<div id="box4" class="box">
<h1>CONTACTO</h1>
<form id="form1" name="form1" method="post" action="enviar.php"> 
<div align="center"> 
<table width="320" border="0" cellspacing="5" cellpadding="5"> 
<tr> 
<td width="54">Nombre:</td>
<td width="266"><div align="center"> 
<input type="text" name="nombre" id="nombre" /> 
</div></td> 
</tr> 
<tr> 
<td>Ciudad:</td>
<td><div align="center"> 
<input type="text" name="ciudad" id="ciudad" /> 
</div></td> 
</tr> 
<tr> 
<td>e-mail:</td> 
<td><div align="center"> 
<input type="text" name="mail" id="mail" /> 
</div></td> 
</tr>
<td>Telf:</td>
<td><div align="center"> 
<input type="text" name="telefono" id="telefono" />
</div></td> 
</tr>  
<tr> 
<td>Asunto:</td> 
<td><div align="center"> 
<label> 
<select name="asunto" id="asunto"> 
<option>Info</option> 
<option>Sugerencia</option> 
<option>Comentarios</option> 
</select> 
</label> 
</div></td> 
</tr> 
<tr> 
<td valign="top">Mensaje:</td> 
<td><textarea name="mensaje" id="mensaje" cols="30" rows="5"></textarea></td> 
</tr> 
<tr> 
<td colspan="2"><div align="center"> 
<input type="submit" name="enviar" id="enviar" value="Enviar" />
<input type="reset" name="borrar" value="Borrar" id="borrar" /> 
</div></td> 
</tr> 
</table> 
</div>
</div>


<!-- Footer -->
<div id="footer">
<p><a href="contacto.html"><img src="img/cbd.gif" class="btns" alt="CreatedByDanoRox" /></a> <a href="http://validator.w3.org/check?uri=referer"><img class="btns" src="http://www.w3.org/Icons/valid-xhtml10" alt="XHTML 1.0 Strict Valido!" /></a> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img src="http://jigsaw.w3.org/css-validator/images/vcss-blue" class="btns" alt="CSS Valido!" /></a></p>
</div>
</body>
</html> 
Agradezco a quien pueda ayudarme!!!

Atte. DanoRox