-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfeedback.php
47 lines (38 loc) · 1.36 KB
/
feedback.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
<?php
//FILTER_VALIDATE_EMAIL
//FILTER_VALIDATE_INT Min Max
//FILTER_VALIDATE_URL
use PHPMailer\PHPMailer\PHPMailer;
require 'vendor/autoload.php';
require_once("base.php");
if (isset($_POST['cons'])){
try {
$c = checks($_POST['attendLGM'], 0, 300);
$d = checks($_POST['cons'], 0, 500);
$f = checks($_POST['favlgm'], 0, 500);
$g = checks($_POST['favreason'], 0, 500);
$h = checks($_POST['propaganda'], 0, 1000);
$i = checks($_POST['name'], 0, 100);
$csv = [d($c), d($d), d($f), d($g), d($h), d($i)];
$mail = new PHPMailer();
$mail->setFrom('[email protected]', 'Afgral LGM');
$mail->addReplyTo('[email protected]', 'Afgral LGM');
$mail->addAddress("[email protected]", 'Afgral LGM'); // adds new recipients
$mail->Subject = '[WITNESS] LGM';
$mail->isHTML(false);
$mail->Body = implode("\n", $csv);
if (!$mail->send()) {
# Message not sent !
header('Location:en/feedback_fail.html');
#echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
# Message sent!
header('Location:en/feedback_sent.html');
}
//header('Location: en/program.html');
} catch( PDOException $Exception ) {
echo $Exception->getMessage( );
echo $Exception->getCode( );
}
}
?>