-
Notifications
You must be signed in to change notification settings - Fork 0
/
process.php
42 lines (30 loc) · 1.13 KB
/
process.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
$to_email = "office@studentguide.at";
if ($_POST) {
header('Access-Control-Allow-Origin: *');
$parameters = "" ;
foreach ($_REQUEST as $key => $value)
{
if(strlen($key) > 3) {
if ((is_array($value)) or ($value instanceof Traversable)) {
$parameters = $parameters . $key. " - ";
foreach ($value as $arrayvalue) {
$parameters = $parameters . $arrayvalue." \n";
}
}
else{
$parameters = $parameters . $key. " - ".$value."\n";
}
}
}
$req_dump = print_r( $_REQUEST, true );
$fp = file_put_contents( 'request.log', "\xEF\xBB\xBF". $parameters."\n", FILE_APPEND );
$send_mail = mail_utf8 ( $to_email, 'studentguide.at', $_POST .
email, 'Kontaktanfrage', $parameters );
}
function mail_utf8($to, $from_user, $from_email, $subject = '(No subject)', $message = '') {
$from_user = "=?UTF-8?B?" . base64_encode ( $from_user ) . "?=";
$subject = "=?UTF-8?B?" . base64_encode ( $subject ) . "?=";
$headers = "From: $from_user <$from_email>\r\n" . "MIME-Version: 1.0" . "\r\n" . "Content-type: text; charset=UTF-8" . "\r\n";
return mail ( $to, $subject, $message, $headers ); }
?>