-
Notifications
You must be signed in to change notification settings - Fork 4
/
_contact.php
70 lines (55 loc) · 2.2 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
<?php
/*
Copyright 2020 FWBer.com
This file is part of FWBer.
FWBer is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
FWBer is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero Public License for more details.
You should have received a copy of the GNU Affero Public License
along with FWBer. If not, see <https://www.gnu.org/licenses/>.
*/
session_start();
include("_init.php");
include("_debug.php");
include("_names.php");
if($_SERVER["REQUEST_METHOD"] != "POST"){header('Location: '.getSiteURL());exit();}
include("_profileVars.php");
include("_secrets.php");
include("_globals.php");
include("_emailFunctions.php");
$db = mysqli_connect($dburl,$dbuser,$dbpass);
if(!$db)exit(mysqli_connect_error());
//make sure we've got an action.
$message = "";
$subject = "";
$emailAddress = "";
if(!isset($_POST['message'])||empty($_POST['message']))exit('message'); else $message= mysqli_escape_string($db,convert_line_breaks($_POST['message']));
if(!isset($_POST['subject'])||empty($_POST['subject']))exit('subject'); else $subject= mysqli_escape_string($db,$_POST['subject']);
if(isset($_POST['emailAddress'])&&!empty($_POST['emailAddress']))
$emailAddress= mysqli_escape_string($db,$_POST['emailAddress']);
if($message!="")
{
sendContactEmail($subject,$message,$emailAddress);
}
mysqli_close($db);
?>
<!doctype html>
<html lang="en">
<head>
<title><?php require_once("_names.php"); echo getSiteName(); ?> - Contact Us<?php require_once("_names.php"); echo getTitleTagline(); ?></title>
<?php include("head.php");?>
</head>
<body class="d-flex flex-column h-100">
<?php include("h.php");?>
<div align="center" style="font-size:16px;">
Thank you for contacting us, we will get back to you.
</div>
<meta http-equiv="refresh" content="3;url=/"/>
<?php include("f.php");?>
</body>
</html>