-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontactenos.php
139 lines (113 loc) · 6.42 KB
/
contactenos.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title> Contactenos </title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="stylesheet" href="assets/css/bootstrap.css">
<link rel="stylesheet" href="assets/css/normalize.css">
<link rel="stylesheet" href="validacionStyle.css">
<script src="assets/js/jquery-v1.10.2.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.validate.js"></script>
<script src="assets/js/modernizr2.6.2.js"></script>
</head>
<body>
<?php
if (isset($_POST['email'])) {
// Debes editar las próximas dos líneas de código de acuerdo con tus preferencias
$email_to = "[email protected]";
$email_subject = "Contacto desde el sitio web";
// Aquí se deberían validar los datos ingresados por el usuario
if (!isset($_POST['nombre']) ||
!isset($_POST['telefono']) ||
!isset($_POST['email']) ||
!isset($_POST['motivo']) ||
!isset($_POST['mensaje'])) {
echo "<b>Ocurrió un error y el formulario no ha sido enviado. </b><br />";
echo "Por favor, vuelva atrás y verifique la información ingresada<br />";
die();
}
$email_message = "Detalles del formulario de contacto:\n\n";
$email_message .= "Nombre: " . $_POST['nombre'] . "\n";
$email_message .= "Telefono: " . $_POST['telefono'] . "\n";
$email_message .= "E-mail: " . $_POST['email'] . "\n";
$email_message .= "Motivo: " . $_POST['motivo'] . "\n";
$email_message .= "Mensaje: " . $_POST['mensaje'] . "\n\n";
// Ahora se envía el e-mail usando la función mail() de PHP
$headers = 'From: ' . $email_from . "\r\n" .
'Reply-To: ' . $email_from . "\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
echo "¡El formulario se ha enviado con éxito!";
}
?>
<div id="header1" class="navbar navbar-default navbar-static-top"></div>
<div id="error"></div>
<!-- // Script para cargar recursos html con jQuery en una pagina -->
<script>$(document).ready(function() {
$("#header1").load("layout/public-header.html", function(status, xhr) {
if (status == "error")
{
var msg = "Lo lamentamos, ha habido un errror cargando el Menu: ";
$("#error").html(msg + xhr.status + " " + xhr.statusText);
}
});
});</script>
<div id="contenedor" class="container">
<div class="panel panel-primary">
<div class="panel-heading">Contactenos</div>
<div class="panel-body">
<form action="#" name="contact" method="POST" class="form-horizontal" >
<div class="form-group">
<div class="form-group">
<label for="Nombre" class="col-lg-3 control-label" >Nombre</label>
<div class="col-lg-4">
<input type="text" name="nombre" class="form-control" placeholder="Escriba un nombre" required pattern=.{4,25} >
</div>
</div>
<div class="form-group">
<label for="Telefono_Contacto" class="col-lg-3 control-label"> Telefono de Contacto </label>
<div class="col-lg-4">
<input type="tel" name="telefono" class="form-control" required pattern=".{7,15}">
</div>
</div>
<div class="form-group">
<label for="Email" class="col-lg-3 control-label">Correo</label>
<div class="col-lg-4">
<input type="email" name="email" class="form-control" placeholder="Escriba un correo aqui" required>
</div>
</div>
<div class="form-group">
<label for="motivo" class="col-lg-3 control-label" >Motivo</label>
<div class="col-lg-4">
<select name="motivo" class="form-control" required="">
<option value="NONE">- Seleccione -</option>
<option value="Dudas en general">Dudas en general</option>
<option value="Problemas con el sistema">Problemas con el sistema</option>
<option value="Recomendaciones">Recomendaciones</option>
<option value="Informacion de registro">Informacion de registro</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<label for="Mensaje" class="col-lg-3 control-label" >Mensaje</label>
<div class="col-lg-6">
<textarea name="mensaje" class="form-control col-lg-6" rows="10" > </textarea>
</div>
</div>
<center> <input type="submit" name="enviar" value="enviar" class="btn btn-primary btn-lg" ></center></form>
</div>
</div>
</div>
</div>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
</body>
</html>