PÁGINA DE CONTACTO (se llama contact-en.php):
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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <title lang="es-ar">Título de la página</title> <link rel="stylesheet" type="text/css" href="estilos-en.css" media="screen"/> <meta http-equiv="Content-Language" content="es-ar"> <meta name="author" content="mi nombre" /> <meta name="owner" content="Mi empresa"> <meta http-equiv="Reply-to" content="[email protected]"> <meta name="copyright" content="Nombre de sitio" /> <meta name="robots" content="index, follow" /> <meta http-equiv="pragma" content="no-cache"> <meta name="keywords" content="bla, bla, bla" /> <meta name="description" content="bla, bla, bla." /> <meta name="rating" content="general" /> <link rel="shortcut icon" href="favicon.ico" > </head> <script> function validar(form) { if(document.form.nombre.value=="" || document.form.email.value=="" ||document.form.asunto.value=="" || document.form.mensaje.value==""){ alert("Enter the data requested by the fields marked with *"); return false; }else{ return true; } } </script> <body id="pg_contacto"> <br /> <div class="global"> <div class="content_out"> <div class="content_top"> <div class="navlang"><a href="contact_es.php"><img src="es.png"/></a><a href="contact_de.php"><img src="de.png"/></a> </div> </div> <!-- BEGIN: Navigation --> <ul id="nav"> <li><a id="inicio" href="index_en.php">Home</a></li> <li><a id="servicios" href="services_en.php">Our services</a></li> <li><a id="muestras" href="samples_en.php">Samples</a></li> <li><a id="clientes" href="customers_en.php">Clients</a></li> <li><a id="contacto" href="#">Contact</a></li> </ul> <!-- END: Navigation --> <div class="content"> <!-- BEGIN: Content --> <div id="columnmain"> <div class="1head"> <div id="idTextPanel"> <form action="enviarcorreo-en.php" name="form" method="post" onsubmit="return validar()"><br/><br/><fieldset id="fieldset"> <legend><span class="Titulo">Contact form</span></legend><br/><br/> <span class="Textorojo">*</span> <span class="Titulo2">Full name</span><br/> <input type="text" name="nombre" size="50" value="" /><br/><br/> <span class="Textorojo">*</span> <span class="Titulo2">E-mail</span><br/> <input type="text" name="email" value="" size="50" maxlength="45" /><br/><br/> <span class="Titulo2">Phone</span><br/> <span class="plain">(</span><input type="text" name="codigo" value="" size="5" maxlength="8" /><span class="plain">)</span> <input type="text" name="telefono" value="" size="14" maxlength="" /><br/><br/> <span class="Textorojo">*</span> <span class="Titulo2">Subject</span><br/> <input type="text" name="asunto" value="" size="50"/><br/><br/> <span class="Textorojo">*</span> <span class="Titulo2">Message</span><br/> <textarea id="descripcion" name="mensaje" cols="38" rows="8"></textarea><br/> <INPUT TYPE="submit" value="Send"><br/><br/><span class="Textorojo">(*) Obligatory fields.</span> </fieldset></form> <br/><br/> </div> </div> </div> <div id="columnright"> <br/><br/><span class="derechacontacto"><img src="envelope.png"/> <a class="email" href="mailto:[email protected]">[email protected]</a></span><br/> <span class="derechanum"><img src="telephone.png"/> (xxxx) xxxxx<br/><br/></span> <span class="derechahorario">Texto de horarios</span><br><br/> <p style="text-align: left;"></p> </div> <!-- END: Content --> </div></div> <div class="footer_bg"> <span class="Estilo3">©2009-<?php echo date("Y") ?> Nombre de empesa. All rights reserved.</span><br /> <br /> </div> <div class="content_end"></div> </div> <br /> </body> </html>
Código PHP:
<?php
header("refresh: 5; url=http://www.linkdelsitio.com");
//Recepción de datos
$nombre=$_POST['nombre'];
$email=$_POST['email'];
$codigo=$_POST['codigo'];
$telefono=$_POST['telefono'];
$asunto=$_POST['asunto'];
$mensaje=$_POST['mensaje'];
//Fin de recepción de datos
//Acción de envío
//---------------//
$para='[email protected],[email protected],[email protected],[email protected]';
$comentario='Mensaje y datos del cliente:
Nombre:'.$nombre.'
Email:'.$email.'
Codigo:'.$codigo.'
Telefono:'.$telefono.'
Asunto:'.$asunto.'
Mensaje:'.$mensaje.'
';
$desde='From: Nombre de empresa <[email protected]>';
ini_set("sendmail_from", "[email protected]");
mail($para,$asunto,$comentario,$desde);
?>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title lang="es-ar">Empresa - Contact</title>
<link rel="stylesheet" type="text/css" href="estilos-en.css" media="screen"/>
<meta http-equiv="Content-Language" content="es-ar">
<meta name="author" content="nombre de autor ([email protected])" />
<meta name="owner" content="Nombre de empresa">
<meta http-equiv="Reply-to" content="[email protected]">
<meta name="copyright" content="Nombre de empresa.com" />
<meta name="robots" content="index, follow" />
<meta http-equiv="pragma" content="no-cache">
<meta name="keywords" content="bla, bla, bla" />
<meta name="description" content="bla, bla, bla" />
<meta name="rating" content="general" />
<link rel="shortcut icon" href="favicon.ico" >
</head>
<script>
function validar(form) {
if(document.form.nombre.value=="" || document.form.email.value=="" ||document.form.asunto.value=="" || document.form.mensaje.value==""){
alert("Enter the data requested by the fields marked with *");
return false;
}else{
return true;
}
}
</script>
<body id="pg_contacto">
<br />
<div class="global">
<div class="content_out">
<div class="content_top">
<div class="navlang"><a href="contact_es.php"><img src="es.png"/></a><a href="contact_de.php"><img src="de.png"/></a>
</div>
</div>
<!-- BEGIN: Navigation -->
<ul id="nav">
<li><a id="inicio" href="index_en.php">Home</a></li>
<li><a id="servicios" href="services_en.php">Our services</a></li>
<li><a id="muestras" href="samples_en.php">Samples</a></li>
<li><a id="clientes" href="customers_en.php">Clients</a></li>
<li><a id="contacto" href="conctact_en.php">Contact</a></li>
</ul>
<!-- END: Navigation -->
<div class="content">
<!-- BEGIN: Content -->
<div id="customers">
<br/><br/><br/><table>
<tr>
<td><img src="images/approved_icon.png"/></td>
<td><span class="approved-text"><span id = "time"></span>
<script type = "text/javascript">
function display(secs) {
if (secs <= 0) {
window.location = "index_en.php";
return false;
}
document.getElementById("time").innerHTML ="Your message has been sent correctly.<br/>You will be redirected to the main page in " + secs + " seconds.";
secs--;
setTimeout("display("+secs+")",1000);
}
display(5);
</script></span></td>
</tr>
</table>
</div>
<!-- END: Content -->
</div></div>
<div class="footer_bg">
<span class="Estilo3">©2009-<?php echo date("Y") ?> Nombre de empresa. All rights reserved.</span><br />
<br />
</div>
<div class="content_end"></div>
</div>
<br />
</body>
</html>