PHP - Ayuda para formulario de contacto

 
Vista:
sin imagen de perfil

Ayuda para formulario de contacto

Publicado por Jorge (2 intervenciones) el 08/07/2015 05:43:15
Amigos
Necesito ayuda porque no logro que funcione el php para poder enviar los datos del formulario de contacto.

Este es el codigo del formulario y posteriormente 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
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
<div class="container">
                    <div class="row">
                        <div class="col-md-8 col-md-offset-2 space">
                        <div id="message"></div>
<h2>Registration Form
</h2>
<div class="wpcf7" id="wpcf7-f2216-p2206-o1" lang="en" dir="ltr">
<div class="screen-reader-response"></div>
				<form action="mailregistrationsandfields.php" method="post">
                    <p>
            <td><span class="texto5">Degree:</span><span class="required">*</span></td>
            <td><select name="degree" size="1" id="degree">
                <option selected="selected">PhD</option>
                <option>Msc</option>
                <option>Student</option>
                <option>Professor</option>
            </select></td></p>
					<p>
						<label for="name">Full Name<span class="required">*</span></label>
						<input id="name" class="aqua_input" name="name" type="text" value="">
					</p>
					<p>
						<label for="institution">Institution<span class="required">*</span></label>
						<input id="institution" class="aqua_input" name="institution" type="text" value="">
					</p>
                    <p>
						<label for="country">Country<span class="required">*</span></label>
						<input id="country" class="aqua_input" name="country" type="text" value="">
					</p>
 
                    <p>
						<label for="address">Address<span class="required">*</span></label>
						<input id="address" class="aqua_input" name="address" type="text" value="">
					</p>
                                <p>
						<label for="mail">Mail<span class="required">*</span></label>
						<input id="mail" class="aqua_input" name="mail" type="text" value="">
					</p>
                    <p>
						<label for="phone">Phone<span class="required">*</span></label>
						<input id="phone" class="aqua_input" name="phone" type="text" value="">
					</p>
 
 
					<p>
						<label for="comment">Message<span class="required">*</span></label>
						<textarea id="comment" rows="2" class="aqua_input" name="comment"></textarea>
					</p>
					<p class="form-submit">
						<input name="submit" type="submit" id="submit" value="Submit" class="button_hilite sm_button">
					</p>
				</form>
 
 
		</div>
			  </div>
</div>                    </div>


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
<?php
 
$degree = $_POST['degree'];
$name = $_POST['name'];
$institution = $_POST['institution'];
$country = $_POST['country'];
$address = $_POST['address'];
$mail = $_POST['mail'];
$phone = $_POST['phone'];
$comment = $_POST['message'];
 
 
$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 .= "Degree       :" . $degree . " \r\n";
$mensaje .= "Full Name    :" . $name . " \r\n";
$mensaje .= "Institution  :" . $institution . " \r\n";
$mensaje .= "Country      :" . $country . " \r\n";
$mensaje .= "Address      :" . $address . " \r\n";
$mensaje .= "Mail         :" . $mail . " \r\n";
$mensaje .= "Phone        :" . $phone . " \r\n";
$mensaje .= "Message      :" . $_POST['comment'] . " \r\n";
$mensaje .= "Send for      :" . date('d/m/y', time());
 
$para = '';
$asunto = 'Registration';
 
mail($para, $asunto, utf8_decode($mensaje), $header);
 
 
header("Location: index.html");
 
?>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder