-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcontact.php
More file actions
119 lines (113 loc) · 3.76 KB
/
contact.php
File metadata and controls
119 lines (113 loc) · 3.76 KB
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
<?php
$body_id = 'contactbody';
if( isset( $_POST['submit'] ) )
{
$name = $_POST['name'];
$email = $_POST['email'];
$messageCon = $_POST['message'];
$to = "all@bookup.org";
$subject = 'Contact Info';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From: '.$name.'<'.$email.'>' . "\r\n";
$message = '<html>
<style>
table td{font-family:arial; line-height:20px;font-size:14px;}
</style>
<body>
<div style="margin:0 auto; padding:0px;border:1px solid #4B89AD;width:700px;">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr><td style="background:#4B89AD; padding:10px;"><img src="http://ourdemosolution.com/studybuddy/html/images/logo-inner.png"></td></tr>
<tr><td style="padding:20px; min-height:200px;">
<table>
<tr>
<td collspan="2">Hello Studdybuddy,<br><br></td>
</tr>
<tr>
<td>Name: </td>
<td>'.$name.'</td>
</tr>
<tr>
<td>Email: </td>
<td>'.$email.'</td>
</tr>
<tr>
<td>Message: </td>
<td>'.$messageCon.'</td>
</tr>
<tr>
<td collspan="2"><br><br>Thanks<br>'.$name.'</td>
</tr>
</table>
</td></tr>
<tr><td style="background:#4B89AD; padding:10px; text-align:center;color:#FFF;">© 2015 BOOKUP. ALL RIGHTS RESERVED.</td></tr>
</table>
</div>
</body>
</html>';
$mail_sent = mail( $to, $subject, $message, $headers );
if( $mail_sent )
{
exit("<script>window.location='contact.php?mes=success';</script>");
}
else
{
$error_msg = 'There is some problem in sending the mail.';
}
}#submit check
?>
<?php require_once('header.php'); ?>
<div class="white_bg padding-page">
<div class="container">
<div class="contactsec">
<div class="row">
<div class="col-md-6 col-sm-6">
<h2>Contact Us</h2>
<form method="post" action="" id="contactform" onsubmit="return validateContactForm();">
<div class="contact-form">
<?php
if( isset($error_msg) && count($error_msg) >0 ){
?>
<p class="error_msg" style="color: #fff; font-size: 14px;padding: 10px;"><?php echo $error_msg;?></p>
<?php
}else if( $_GET['mes'] == 'success' ){
?>
<p class="success_msg" style="color: #fff; font-size: 14px;padding: 10px;">Email has been sent successfully.</p>
<?php
}
?>
<div class="form-group">
<div class="col-md-12 col-sm-12">
<input type="text" placeholder="Name" name="name" id="name" value="<?php echo $_POST['name']; ?>">
</div>
<div class="col-md-12 col-sm-12">
<input type="text" placeholder="Email Address" name="email" id="email" value="<?php echo $_POST['email']; ?>">
</div>
</div>
<div class="form-group">
<div class="col-md-12 col-sm-12">
<textarea rows="" cols="" name="message"><?php echo $_POST['message']; ?></textarea>
</div>
</div>
<div class="form-group">
<div class="col-md-12 col-sm-12">
<input type="submit" name="submit" value="Submit">
</div>
</div>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="contactadd">
<p>This product is made for Dartmouth students by Dartmouth students, and we'd love your feedback. Are there any features you think would be helpful for studying, accessing campus resources, or filtering study buddies? <br>Imagine any feature you want, even if you don't think it's possible.</p>
<div class="address">
<div class="col-group">
<label>e-mail:</label>
<span><a href="mailto:all@bookup.org">team@bookup.org</a></span> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php require_once('footer.php'); ?>