-
Notifications
You must be signed in to change notification settings - Fork 0
/
contacts.php
80 lines (64 loc) · 2.73 KB
/
contacts.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
<?php require_once('init.php'); ?>
<?php
$message = '';
if (!empty($_POST)) {
$name = $_POST["name"];
$email = $_POST["email"];
$message_form = $_POST["message"];
if (!empty($name) && !empty($email) && !empty($message_form)) {
$message_to_send = "Name: " . $name . "<br>";
$message_to_send .= "Email: " . $email . "<br>";
$message_to_send .= "Message: <br>" . $message_form ;
$message_to_send = wordwrap($message_to_send, 70);
// send email
if (mail("simaocostaneves@gmail.com","New contact from Site!", $message_to_send)) {
$message = 'Your message was sended successfully!<br> Thank you very much, will answer as soon as i can!';
}
else {
$message = "Something went very wrong!";
}
}
}
?>
<?php require 'includes/header.php' ?>
<title>Simão Neves - Contact me</title>
<meta name="description" content="A way for you to contact me">
<meta name="keywords" content="Simão Neves, web developer, software engineer, contacts">
<script src="js/contacts.js"></script>
<?php require 'includes/after_header.php' ?>
<header class="content_header">
<h1>Contact me</h1>
<?php printSocial("_min") ?>
</header>
<div class="content">
<div class="double_col section">
<h2>Would love to hear from you</h2>
<div class="vert_bar">
<div class="left_col">
<p>Would you like to recruit me? Catch up on the latest technology trends or just get in touch? Go ahead and fill the form, i’ll answer as soon as i can!<br>
Feel free to check my accounts on Github or Linkedin as well.</p>
<?php printSocial("") ?>
</div>
<div class="right_col">
<?php
if (!empty($message)) {
echo $message;
}
else {
?>
<form action="" onsubmit="return validateForm()" method="post" id="form">
<label>Your name:</label>
<input id="name" type="text" name="name" class="input_style">
<label>Your email:</label><br>
<input id="email" type="email" name="email" class="input_style" required>
<label>Your message:</label><br>
<textarea id="message" name="message" rows="4" class="input_style" required></textarea>
<input type="submit" class="btn">
</form>
<?php } // End if ?>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<?php require 'includes/end.php' ?>