-
Notifications
You must be signed in to change notification settings - Fork 0
/
encouragement.php
42 lines (34 loc) · 1.2 KB
/
encouragement.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
<?php
/* Thanks to https://github.com/kstoltzenburg */
$to = '[email protected]';
$subject = 'New encouragement for metafahr!';
$message = "Aloha!\r\nNew encouragement for metafahr:\r\n" . $_POST['encouragement'] . "\r\n";
$message = wordwrap($message, 70, "\r\n");
$additional_headers = "From: [email protected]\r\n";
mail($to, $subject, $message, $additional_headers);
$fp = fopen('../encouragements.txt', 'a');
if ($fp == false) {
header('HTTP/1.1 500 Internal Server Error');
die("Could not open file for writing.");
}
fputcsv($fp, array_values($_POST));
fclose($fp);
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MetaFahr - encouragement received</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.5.0/pure-min.css" />
<link rel="stylesheet" href="screen.css" />
</head>
<body>
<div id="container">
<div id="query">
<div id="logo"><h1>MetaFahr</h1></div>
<p>Danke!</p>
</div>
</div>
</body>
</html>