-
Notifications
You must be signed in to change notification settings - Fork 0
/
processMulticast.php
30 lines (27 loc) · 1.07 KB
/
processMulticast.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
<?php
$base_url = 'http://' . $_SERVER['HTTP_HOST'] . '/Hacettepe-KDSE-BPYS';
require_once("config-students.php");
require_once('./lib/phpMailer/src/PHPMailer.php');
require_once('./lib/phpMailer/src/SMTP.php');
require_once('./lib/phpMailer/src/Exception.php');
if(isset($_POST['name'])){
$user_email = $_POST['email'];
$user_name = $_POST['name'];
$surname = $_POST['surname'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$emailList = $_POST['emailList'];
foreach ($emailList as $key => $value) {
$sql = "INSERT INTO broadcast (subject, email, to_email, message, name, surname) VALUES (:subject, :email, :to_email, :message, :name, :surname)";
$stmt = $db->prepare($sql);
$stmt->bindParam(':subject', $subject);
$stmt->bindParam(':email', $user_email);
$stmt->bindParam(':to_email', $value);
$stmt->bindParam(':message', $message);
$stmt->bindParam(':name', $user_name);
$stmt->bindParam(':surname', $surname);
$stmt->execute();
}
} else
echo 'post data not set';
?>