-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
145 lines (141 loc) · 6.53 KB
/
contact.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
140
141
142
143
144
145
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
?>
<!DOCTYPE html>
<html lang="ro">
<head>
<meta charset="utf-8">
<title>Contact</title>
<script defer src="https://use.fontawesome.com/releases/v5.3.1/js/all.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css">
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<link rel="icon" href="./images/icon.png">
<style>
div.separator {
padding: 10px 0;
}
.red{
color:red;
}
</style>
</head>
<body>
<nav class="navbar" role="navigation" aria-label="main navigation">
<a role="button" class="navbar-burger burger" aria-label="menu" aria-expanded="false" data-target="Nav">
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
<div id="Nav" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="index.php">Acasă</a>
<div class="navbar-item has-dropdown is-hoverable">
<a href="" class="navbar-link">Evaluare</a>
<div class="navbar-dropdown">
<a href="quiz.php" class="navbar-item">Test</a>
<a href="doc/bac.pdf" class="navbar-item">Model subiect bacalaureat</a>
</div>
</div>
<a href="contact.php" class="navbar-item" style="color:#00d1b2">Contact</a>
<a href="despre.php" class="navbar-item">Despre</a>
</div>
</div>
</nav>
<main>
<div class="hero is-primary">
<div class="hero-body">
<div class="container">
<h1 class="title is-1 has-text-centered">Contactează-ne</h1>
</div>
</div>
</div>
<div class="separator"></div>
<div class="columns is-centered">
<div class="column is-half">
<div class="box">
<div class="content">
<p class="red">*Obligatoriu</p>
</div>
<form action="contact.php" method="post">
<div class="field">
<label class="label">Nume <span class="red">*</span></label>
<div class="control has-icons-left">
<input class="input" name="nume" type="text" required>
<span class="icon is-small is-left">
<i class="fas fa-user"></i>
</span>
</div>
</div>
<div class="field">
<label class="label">E-mail <span class="red">*</span></label>
<div class="control has-icons-left">
<input class="input" name="email" type="email" required>
<span class="icon is-small is-left">
<i class="fas fa-envelope"></i>
</span>
</div>
</div>
<div class="field">
<label class="label">Subiect <span class="red">*</span></label>
<div class="control">
<input class="input" name="subject" type="text">
</div>
</div>
<div class="field">
<label class="label">Mesaj <span class="red">*</span></label>
<div class="control">
<textarea class="textarea" name="text" placeholder="Scrie aici..." required></textarea>
</div>
</div>
<div class="field">
<div class="control">
<button name="submit" class="button is-link">Trimite</button>
</div>
</div>
</form>
<div class="separator"></div>
<div class="content">
<?php
if(isset($_POST['submit']))
{
require 'phpmail/src/Exception.php';
require 'phpmail/src/PHPMailer.php';
require 'phpmail/src/SMTP.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->CharSet = 'UTF-8';
$mail->Host = "smtp.gmail.com";
$mail->SMTPAuth = true;
$mail->Username = "[email protected]";
$mail->Password = "Memoria2410";
$mail->SMTPSecure = "tls";
$mail->Port = 587;
$mail->From = $_POST['email'];
$mail->FromName = $_POST['nume'];
$mail->addReplyTo($_POST['email'], "Reply");
$mail->addAddress("[email protected]");
$mail->isHTML(true);
$mail->Subject = $_POST['subject'];
$mail->Body = $_POST['text'];
if(!$mail->send())
{
echo '<h3 class="has-text-centered" style="color:red">Încearcă mai târziu!</h3>';
}
else echo '<h3 class="has-text-centered" style="color:#00d1b2">Mulțumim pentru feedback!</h3>';
}
?>
</div>
</div>
</div>
</div>
</main>
<script>
$(document).on('click', '.navbar-burger', function() {
$(".navbar-burger").toggleClass("is-active");
$(".navbar-menu").toggleClass("is-active");
});
</script>
</body>
</html>