-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.php
49 lines (31 loc) · 1.05 KB
/
form.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
<?php
//if "email" variable is filled out, send email
if (isset($_REQUEST['email'])) {
//Email information
$admin_email = "[email protected]";
$email = $_REQUEST['email'];
$subject = $_REQUEST['subject'];
$comment = $_REQUEST['comment'];
if($email != '' && $subject != '' && $comment != '') {
//send email
mail($admin_email, "$subject", $comment, "From:" . $email);
//Email response
echo "<SCRIPT type='text/javascript'> //not showing me this
alert('Success !');
window.location.replace(\"contact.php\");
</SCRIPT>";
} else {
echo "<SCRIPT type='text/javascript'> //not showing me this
alert('All Fields Required !');
window.location.replace(\"contact.php\");
</SCRIPT>";
}
}
//if "email" variable is not filled out, display the form
else {
echo "<SCRIPT type='text/javascript'> //not showing me this
alert('Failed !');
window.location.replace(\"contact.php\");
</SCRIPT>";
}
?>