-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.php
120 lines (100 loc) · 3.66 KB
/
contact.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?php
/*
if (isset($_POST['submit']) && !empty($_POST['name'])){
$name = $_POST['name'];
$from = "user@example.com";
$to = "your@example.com";
$subject = "add this";
$headers="From: $name <$from>";
$sent = mail($to, $subject, $name, $headers);
if($sent) {
echo "Success";
} else {
echo 'Sorry, your message could not be sent.';
}
} // brace for submit conditional statement
*/
@ini_set('default_charset', 'UTF-8');
$errors = '';
$myemail = 'schuybreach@gmail.com';//<-----Put Your email address here.
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']))
{
$errors .= "\n Error: all fields are required";
}
$name = $_POST['name'];
$email_address = $_POST['email'];
$message = $_POST['message'];
if (!preg_match(
"/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i",
$email_address))
{
$errors .= "\n Error: Invalid email address";
}
if( empty($errors))
{
$to = $myemail;
$email_subject = "Contact form submission: $name";
$email_body = "You have received a new message. ".
" Here are the details:\n Name: $name \n Email: $email_address \n Message \n $message";
$headers = "From: $myemail\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
//redirect to the 'thank you' page
//header('Location: contact.html');
}
?>
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="description" content="Schuyler Meyer /\\ SchuyTyr Media — Contact">
<meta name="keywords" content="Contact,Email,Social Media,Message,Photography,Digital Art,Game Design,VR,Software,Engineering,Animation,Schuyler Meyer,Schuyler,Meyer,Skyler,SchuyTyr,SchuyTyr Art,SchuyTyr Media,Design,Developer">
<meta name="author" content="Schuyler Meyer">
<title>SM - Contact</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="stylesSM.css" rel="stylesheet">
<link href="stylesSM2.css" rel="stylesheet">
<link href="src/icons/SMLogo2022.ico" rel="shortcut icon">
<link href="https://fonts.googleapis.com/css?family=Audiowide|Orbitron|Merienda&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://use.typekit.net/ozq0omu.css"> <!-- Adobe font - nasalization -->
<script src="src/js/footer-main.js" type="text/javascript" defer></script>
</head>
<body>
<header>
<h1 title="Schuyler Meyer">
<a href="https://www.schuylermeyer.com">
<img alt="Schuyler Meyer" class="imgLogo" src="src/img/SMSignLogo2021.png">
</a>
</h1>
<p class="topDesc"><u> Photography ⁘ Design ⁘ Game Developer ⁘ VR ⁘ Software Engineering ⁘ Animation </u></p>
<hr class="rounded">
<nav>
<!-- Copy / Paste for more buttons or decoration
<button class="pageButtonFalse">
<div class="pageButtonTxt"> ———— </div>
</button>
-->
<button class="pageButtonSkew" onclick="window.location.href='aboutSM.html';" title="About the Schuy">
<div class="pageButtonTxt"> About </div>
</button>
<button class="pageButtonSkew" style="cursor:wait;" title="Coming Soon!">
<div class="pageButtonTxt"> Contact </div>
</button>
<button class="pageButtonSkew" onclick="window.open('https://schuybox.wordpress.com/','_blank')" title="To the SchuyBox!">
<div class="pageButtonTxt"> Blog </div>
</button>
</nav>
<hr class="rounded">
</header>
<br><br>
<!-- This page is displayed only if there is some error -->
<?php
echo nl2br($errors);
?>
<br><br>
<template id="footer-main">
</template>
</body>
</html>