Skip to content

Commit 69f10a4

Browse files
committed
added contact form
1 parent d0b3599 commit 69f10a4

File tree

3 files changed

+79
-0
lines changed

3 files changed

+79
-0
lines changed

contact.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/*require 'PHPMailer/PHPMailerAutoload.php';
3+
4+
$mail = new PHPMailer;
5+
6+
//$mail->SMTPDebug = 3; // Enable verbose debug output
7+
8+
$mail->isSMTP(); // Set mailer to use SMTP
9+
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
10+
$mail->SMTPAuth = true; // Enable SMTP authentication
11+
$mail->Username = 'weareastralbear@gmail.com'; // SMTP username
12+
$mail->Password = 'Weatherman2015!'; // SMTP password
13+
$mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
14+
$mail->Port = 465; // TCP port to connect to
15+
16+
$mail->From = $_POST['email'];
17+
$mail->FromName = $_POST['name'];
18+
$mail->addAddress('weareastralbear@gmail.com', 'Astral Bear'); // Add a recipient, Name is optional
19+
//$mail->addReplyTo('info@example.com', 'Information');
20+
//$mail->addCC('cc@example.com');
21+
22+
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Add attachement, Optional name
23+
$mail->isHTML(true); // Set email format to HTML
24+
25+
$mail->Subject = $_POST['subject'];
26+
$mail->Body = $_POST['message'];
27+
//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
28+
29+
if(!$mail->send()) {
30+
echo 'Message could not be sent.';
31+
echo 'Mailer Error: ' . $mail->ErrorInfo;
32+
33+
} else {
34+
echo 'Message has been sent';
35+
header('Location: index.php');
36+
}*/
37+
38+
$headers = 'From: '.$_POST['email'] . "\r\n" .
39+
'Reply-To: '.$_POST['email'] . "\r\n" .
40+
'X-Mailer: PHP/' . phpversion();
41+
42+
mail('weareastralbear@gmail.com', $_POST['subject'], $_POST['message'], $headers);
43+
44+
header('Location: index.html');
45+
?>

index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<li><a href="#about">About</a></li>
2626
<li><a href="#schedule">Schedule</a></li>
2727
<li><a href="#sponsors">Sponsors</a></li>
28+
<li><a href="#contact">Contact</a></li>
2829
<li><a href="register.php">Register</a></li>
2930
</ul>
3031
</nav><!-- end NAV -->
@@ -84,6 +85,38 @@ <h1>Sponsors</h1>
8485
</p>
8586
</div><!-- end sponsors -->
8687

88+
<div class="container-fluid" style="background-color: #222;color: #FFF">
89+
<div id="contact" class="container">
90+
<h1>Contact Us</h1>
91+
<p>Sponsors can contact us here</p>
92+
<form method="POST" action="contact.php">
93+
<div class="form-group">
94+
<label for="name">Name: </label>
95+
<input type="text" class="form-control" id="name" name="name" placeholder="Enter Name">
96+
</div>
97+
98+
<div class="form-group">
99+
<label for="email">Email: </label>
100+
<input type="email" class="form-control" id="email" name="email" placeholder="Enter email">
101+
</div>
102+
103+
<div class="form-group">
104+
<label for="subject">Subject: </label>
105+
<input type="text" class="form-control" id="subject" name="subject" placeholder="Enter Subject">
106+
</div>
107+
108+
<div class="form-group">
109+
<label for="message">Message: </label>
110+
<textarea class="form-control" rows="20" id="message" name="message" placeholder="Enter Message"></textarea>
111+
</div>
112+
<button type="submit" class="btn btn-primary">
113+
<span class="fa fa-paper-plane"></span>
114+
Contact
115+
</button>
116+
</form><!-- end contact form -->
117+
</div><!-- end contact div -->
118+
</div>
119+
87120
<!-- FOOTER -->
88121
<div id="footer" class="container-fluid">
89122
<div class="container">

register.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
<li><a href="index.html#about">About</a></li>
6565
<li><a href="index.html#schedule">Schedule</a></li>
6666
<li><a href="index.html#sponsors">Sponsors</a></li>
67+
<li><a href="index.html#contact">Contact</a></li>
6768
<li><a href="register.php">Register</a></li>
6869
</ul>
6970
</nav>

0 commit comments

Comments
 (0)