-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
286 lines (239 loc) · 7.21 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
<!-- <?php
require 'phpmailer/src/Exception.php';
require 'phpmailer/src/PHPMailer.php';
require 'phpmailer/src/SMTP.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
if (isset($_POST["Send"])) {
// Get form data
$name = $_POST["name"];
$email = $_POST["email"];
$message = $_POST["message"];
// Create a new PHPMailer instance
$mail = new PHPMailer(true);
try {
// SMTP configuration
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'fbenqhknmusvlebl';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
// Sender and recipient
$mail->setFrom($email, $name); // Sender's email and name
$mail->addAddress('[email protected]'); // Admin's email
// Email content
$mail->isHTML(true);
$mail->Subject = "Contact Information from $name";
$mail->Body = "<p><strong>Name:</strong> $name</p>
<p><strong>Email:</strong> $email</p>
<p><strong>Message:</strong></p>
<p>$message</p>";
// Send email
if ($mail->send()) {
echo '<script>alert("Message has been sent successfully.");</script>';
} else {
echo '<script>alert("Error: '. $mail->ErrorInfo. '");</script>';
}
} catch (Exception $e) {
echo '<script>alert("An error occurred. Please try again later.");</script>';
echo 'Error: '. $e->getMessage(); // Display detailed PHPMailer exception message
}
}
?> -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap"
rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<link rel="stylesheet" href="indexstyle.css" .css>
<title>DSI Tutoring | Contact</title>
</head>
<style>
.input-container {
position: relative;
margin: 1rem 0;
}
.input {
width: 100%;
outline: none;
border: 2px solid #fafafa;
background: none;
padding: 0.6rem 1.2rem;
color: #fff;
font-weight: 500;
font-size: 0.95rem;
letter-spacing: 0.5px;
border-radius: 5px;
transition: 0.3s;
}
textarea.input {
padding: 0.8rem 1.2rem;
min-height: 150px;
border-radius: 5px;
resize: none;
overflow-y: auto;
}
.btn {
padding: 0.6rem 1.3rem;
background-color: #4b1290;
border: none;
font-size: 0.95rem;
color: #fff;
line-height: 1;
border-radius: 5px;
outline: none;
cursor: pointer;
transition: 0.3s;
margin-left: 20px;
width: 100%;
position: relative;
margin: 1rem 0;
margin-left: 20px;
}
.btn:hover {
background-color: #360f6f;
}
.right-box{
text-align: center;
}
.contact-info {
padding: 2.3rem 2.2rem;
position: relative;
}
.contact-info .title {
color: #1abc9c;
}
.text {
color: #fff;
margin: 1.5rem 0 2rem 0;
}
.information {
display: flex;
color: #555;
margin: 0.7rem 0;
align-items: center;
font-size: 0.95rem;
}
.information i {
color: #1ABC9C;
}
.icon {
width: 28px;
margin-right: 0.7rem;
}
.social-media {
padding: 2rem 0 0 0;
}
.social-media p {
color: #333;
}
.social-icons {
display: flex;
margin-top: 0.5rem;
}
.social-icons a {
width: 35px;
height: 35px;
border-radius: 5px;
background: linear-gradient(45deg, #4b1290, #149279);
color: #fff;
text-align: center;
line-height: 35px;
margin-right: 0.5rem;
transition: 0.3s;
}
.social-icons a:hover {
transform: scale(1.05);
}
.form{
display: flex;
}
.left-box{
display: flex;
}
</style>
<body>
<header>
<div class="logo">
<a href=""></a><img src="home.page.pic\logo.png" alt="Logo">
</div>
<nav>
<a href="index.php" target="_self">Home</a>
<div class="dropdown">
<a href="#">SUBJECTS</a>
<div class="dropdown-content">
<a href="register.php" target="_self">DEVELOPMENT SOFTWARE 1</a>
<a href="register.php" target="_self">DEVELOPMENT SOFTWARE 2</a>
<a href="register.php" target="_self">TECHNICAL PROGRAMMING 1</a>
</div>
</div>
<a href="contact.php" target="_self" style="color:#4b1290;">CONTACT</a>
<a href="login.php" target="_self">LOGIN</a>
</nav>
<button onclick="window.location.href='register.php'">GET A TUTOR</button>
</header>
<main>
<h1 style="text-align: center;">Enquiry Details</h1>
<div class="container">
<div class="left-box">
<div class="form">
<div class="contact-info">
<p class="text">
If you have any questions or need assistance, please contact us.
</p>
<div class="info">
<div class="information">
<i class="fas fa-map-marker-alt"></i>    
<p>Potsdam East, Eastern Cape, East London 5219</p>
</div>
<div class="information">
<i class="fas fa-envelope"></i>    
<p>[email protected]</p>
</div>
<div class="information">
<i class="fas fa-phone"></i>  
<p>064-858-7175</p>
</div>
</div>
<!-- <div class="social-media">
<p style="color:#fff;">Connect with us: </p>
<p> </p>
<div class="social-icons">
<a href="#">
<i class="fab fa-facebook-f"></i>
</a>
<a href="#">
<i class="fab fa-twitter"></i>
</a>
<a href="#">
<i class="fab fa-instagram"></i>
</a>
<a href="#">
<i class="fab fa-linkedin-in"></i>
</a>
</div>
</div>
</div> -->
<!-- <div class="contact-info" style="width: 30vh;">
<form method="post" >
<div class="input-container">
<input type="text" name="name" class="input" placeholder="Enter your First Name" />
</div>
<div class="input-container">
<input type="email" name="email" class="input" placeholder="Enter you Email Address"/>
</div>
<div class="input-container textarea">
<textarea name="message" class="input" placeholder="Enter your message"></textarea>
</div>
<input type="submit" name="Send" class="btn" />
</form> -->
</div>
</div>
</main>
</body>
</html>