-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.php
65 lines (51 loc) · 2.21 KB
/
demo.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
<?php session_start(); ?>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Jenny May</title>
</head>
<body>
<?php
include_once 'header.php';
include 'config.inc.php';
?>
<div id="thankyou">
<div class="container">
<?php
try {
$sql = "INSERT INTO " . $table . " (username, phone, email, comment) VALUES ('".$_POST["user_name"]."','".$_POST["phone"]."','".$_POST["email"]."', '".$_POST["comment"]."')";
if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
if ($conn->query($sql)) {
// Email admin
mail('jmay_mua@yahoo.com', 'New user registration', "Seems like you have a new customer, contact him/her ASAP. Contact information: " . $_POST["user_name"] . ', ' . $_POST["phone"] . ', ' . $_POST['email'] .' , ' . $_POST["comment"]);
//mail('jmay_mua@yahoo.com' 'New user registration', "Seems like you have a new customer, contact him/her ASAP. " );
// Email the user who signed up
mail($_POST['email'], 'from Jenny May', "Thank you for contact me. I will be in touch soon! JMay");
}
echo '<h2 class ="message text-center"> Thank you for your message, I will contact you soon.</h2>' ;
} else {
echo '<h2 class ="message text-center"> the information is not valid</h2>';
}
} catch(PDOException $e) {
echo '<h2 class ="message text-center"> Connection failed: </h2>' . $e->getMessage();
}
?>
</div>
</div>
<!--==============================FOOTER=============================================-->
<footer class="footer fixfooter">
<div class="container">
<p class="text-muted">© MakeUp by JMay <?php echo date("Y"); ?></p>
</div>
</footer>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/tiltfx.js"></script>
</body>
</html>