forked from OSHAYE/OSHAYE.hackathaon2021.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cont.php
74 lines (69 loc) · 2.61 KB
/
cont.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="cont.css">
<script src="cont.js"></script>
<title>Document</title>
</head>
<body>
<div class="row">
<div class="col-md-6 " id="form_container">
<h2>Contact Us</h2>
<p>
Please send your message below. We will get back to you at the earliest!
</p>
<form role="form" method="post" id="reused_form">
<div class="row">
<div class="col-sm-12 form-group">
<label for="message">
Message:</label>
<textarea class="form-control" type="textarea" id="message" name="message" maxlength="6000" rows="7"></textarea>
</div>
</div>
<div class="row">
<div class="col-sm-6 form-group">
<label for="name">
Your Name:</label>
<input type="text" class="form-control" id="name" name="name" required>
</div>
<div class="col-sm-6 form-group">
<label for="email">
Email:</label>
<input type="email" class="form-control" id="email" name="email" required>
</div>
</div>
<div class="row">
<div class="col-sm-12 form-group">
<button type="submit" class="btn btn-lg btn-default pull-right" >Send →</button>
</div>
</div>
</form>
<div id="success_message" style="width:100%; height:100%; display:none; ">
<h3>Posted your message successfully!</h3>
</div>
<div id="error_message"
style="width:100%; height:100%; display:none; ">
<h3>Error</h3>
</div>
</div>
</div>
</body>
</html>
<?php
session_start();
if (isset($_POST['submit'])) {
$name = $_POST['name'];
$message = "Hi i am ".$name." ".$_POST['message'];
$subject = "Need help";
$headers = "From:" . $_POST['email'];
$to = "[email protected]";
if (mail($to, $subject, $message, $headers)) {
echo "Successfully sent!";
// header("location:index.html");
} else {
echo 'oops! Somthing went wrong';
}
}
?>