Ayuda con formulario
Publicado por Indirelis (3 intervenciones) el 08/12/2014 15:42:40
Hola, estoy haciendo una pagina web, sencilla porque yo no se nada de programacion pero bueno logré hacer un formulario de reservacion y quiero que los mensajes que me envíen lleguen a traves del servidor y no como un mensaje por outlook busque en internet las indicaciones de como hacerlo pero me da error y ya no se que hacer, será que alguien me puede ayudar:
este es el codigo del formulario:
y este el el php:
agradeceria cualquier ayuda gracias
este es el codigo del formulario:
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
<div style="padding-left:5px">
<form id="FormularioReservacion" name="FormularioReservacion" method="post" action="enviar.php" style="margin:auto;">
<table width="95%" border="0" align="center" cellpadding="4" cellspacing="0">
<tr>
<td width="50%" align="left" valign="top"><table width="300" border="0">
<tr>
<td width="167"><span class="Estilo17">Name and Last Name </span></td>
<td width="117"><span class="Estilo17">Check-in Date</span></td>
</tr>
<tr>
<td><input name="textfield" type="text" /></td>
<td><input type="text" name="textfield2" style="width:60%;"/></td>
</tr>
</table>
<table width="300" border="0">
<tr>
<td width="167"><span class="Estilo17">Your email </span></td>
<td width="117"><span class="Estilo17">Check-out Date </span></td>
</tr>
<tr>
<td><input type="text" name="textfield3" /></td>
<td><input type="text" name="textfield4"style="width:60%;" /></td>
</tr>
</table>
<table width="300" border="0">
<tr>
<td width="82"><span class="Estilo17">Persons</span></td>
<td width="244"><span class="Estilo17">Others</span></td>
</tr>
<tr>
<td><select name="select"style="width:70%;">
<option>-</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>More</option>
</select>
</td>
<td><input type="text" name="textfield5" />
<input type="submit" name="Submit" value="Submit" /></td>
</tr>
</table></td>
</tr>
</table>
</form>
</div>
y este el el 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
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$Check-in Date = $_POST['Check-in Date'];
$Check-out Date = $_POST['Check-out Date'];
$persons = $_POST['persons'];
$others = $_POST['others'];
$header = 'From: ' . $mail . " \r\n";
$header .= "X-Mail: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";
$mensaje = "Este mensaje fue enviado por " . $name . ",
su email es " . $email . " \r\n";
$mensaje .= "Dia de llegada" . $Check-in Date . " \r\n";
$mensaje .= "Dia de salida" . $Check-out Date . " \r\n";
$mensaje .= "Cantidad de huespedes" . $_POST['persons'];
$mensaje .= "Enviado el " . date('d/m/Y', time());
$para = 'aqui puse mi email';
$asunto = 'De www.havanastay.net46.net ';
mail($para, $asunto, utf8_decode($mensaje), $header);
echo 'Mensaje enviado correctamente';
?>
agradeceria cualquier ayuda gracias
Valora esta pregunta


0