-
Notifications
You must be signed in to change notification settings - Fork 0
/
contactform.php
42 lines (33 loc) · 1.08 KB
/
contactform.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
<html>
<head>
<title>Darqor email Submission</title>
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>
function myFunction(){
swal({
title: "message sent!",
text: "You have registered with our mailing list for exclusive deals and promos.",
icon: "success",
}).then(function() {
window.location = "index.html";
});
}
</script>
</head>
<body>
<?php
if(isset($_POST['submit'])){
$name = $_POST['name'];
// $subject = $_POST['subject'];
$mailFrom = $_POST['mail'];
// $message = $_POST['message'];
$mailTo = "hello@darqor.com";
$headers = "From: ".$mailFrom;
$txt ="You have received an email from ".$name.".\n\n";
mail($mailTo, $txt, $headers);
//header("Location: index.php?mailsend");
echo "<script type='text/javascript'>myFunction()</script>";
}
?>
</body>
</html>