-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsendform.php
96 lines (86 loc) · 3.7 KB
/
sendform.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<html lang="en">
<head>
<title>Send form redirect</title>
<link rel="shortcut icon" href="pic/favicon.ico">
<meta charset="utf-8"></meta>
<meta content="IE=edge" http-equiv="X-UA-Compatible"></meta>
<meta content="width=device-width, initial-scale=1" name="viewport"></meta>
<!-- Important meta tags according to getbootstrap.com -->
<meta content="" name="This is the volunteers page for Forever Furries Adoption repository"></meta>
<meta content="" name="CS361 Project B"></meta>
<!--TO VIEW UNIT TESTS -->
<META http-equiv="refresh" content="10;URL=http://web.engr.oregonstate.edu/~colliell/home.html">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="css/bootstrap.css"></link>
<!-- Bootstrap theme -->
<link rel="stylesheet" href="css/bootstrap-theme.css"></link>
</head>
<body role="document">
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<div class="container theme-showcase" role="main">
<!-- This class creates a gray block for large text on the page -->
<div class="jumbotron">
<h1>
<?php
$user = "[email protected]"; //delete this line and use $email for real testing
$subject2 = "Your form has been submitted";
//$shelter = $_POST['mySelect']; changing to instructor for this project
$shelter = "[email protected]"; //instructor's email
$subject = "Volunteer form submitted";
$first = $_POST['firstName'] ;
$last = $_POST['lastName'];
$email = $_POST['Email'];
$exp = $_POST['Experience'];
$qs = $_POST['Questions'];
$headers = "From: [email protected]";
$body ="Hello " . $shelter . ",<br><br>" . "We have received the following information from a recently submitted online volunteer interest form.<br><br>".
"Name: " . $first . " " . $last . "<br>" . "Email: " . $email . "<br>" . "Experience: " . $exp . "<br>" . "Questions: " . $qs . "<br><br>" .
"Please contact us with any questions. As always, thanks for helping our furry friends!<br><br>" . "Sincerely,<br>Forever Furries team";
$body2 ="Hello " . $first . ",<br><br>We have begun processing your volunteer form through the designated shelter.<br>" . "You can contact them directly at " .
$shelter . ".<br>Here's the information we received.<br><br>" . "Name: " . $first . " " . $last . "<br>" . "Email: " . $email . "<br>" . "Experience: " . $exp .
"<br>Questions: " . $qs . "<br><br>" . "Please contact us with any questions. Thank you for volunteering!<br><br>" . "Sincerely,<br>Forever Furries team";
$send = mail($shelter, $subject, $body, $headers);
$send2 = mail($email, $subject2, $body2, $headers);
//UNIT TESTS FOR SEND SUCCESS//
if($send and $send2)
{
print ("Success<br>");
}
else
{
print ("We encountered an error sending your mail, please notify [email protected]<br>");
}
?>
</h1>
</div>
<p>
<h3>
Redirecting...
</h3>
<h4>
<?php
//UNIT TESTS FOR VARIABLE STORAGE//
print("User email: ");
echo $email . "<br>";
print("User subject: ");
echo $subject2 . "<br>";
print("Shelter email: ");
echo $shelter . "<br>";
print("Shelter subject: ");
echo $subject . "<br>";
print("Name: ");
echo $first . " " . $last . "<br>";
print("Experience: ");
echo $exp . "<br>";
print("Questions: ");
echo $qs . "<br>";
print("Header: ");
echo $headers . "<br>";
?>
</h4>
</p>
</div>
</html>