Skip to content

Commit

Permalink
#6
Browse files Browse the repository at this point in the history
  • Loading branch information
sazanof authored Aug 29, 2017
1 parent 7355c53 commit 4331a8c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions assets/modules/letters/inc/subscriber.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,14 @@
$firstname = $modx->db->escape($_POST['firstname']);
$lastname = $modx->db->escape($_POST['lastname']);
$cat_id = @implode(',',$_POST['cat_id']);
$sql = "INSERT INTO " . TBL_SUBSCRIBERS . "
(email, firstname, lastname, cat_id, created) VALUES ('" . $email . "','" . $firstname . "','" . $lastname . "','" . $cat_id . "', NOW())
ON DUPLICATE KEY UPDATE
email='$email',
firstname='$firstname',
lastname='$lastname',
cat_id='$cat_id',
created=NOW()
";
//echo $sql;
$sub_id = isset($_POST['sub_id']) ? intval($_POST['sub_id']): false;
$data = [
'email'=>$email,
'firstname'=>$firstname,
'lastname'=>$lastname,
'cat_id'=>$cat_id
];
$subscribers->InsOrUpdSubscriber($data,$sub_id);
if (filter_var($email,FILTER_VALIDATE_EMAIL)){
// add realemail check
//if ($realemail->checkEmail($email) == 1 or $realemail->checkEmail($email) == 2){
Expand Down Expand Up @@ -201,4 +199,4 @@
</div>
</div>
</div>';
$content .= $html;
$content .= $html;

0 comments on commit 4331a8c

Please sign in to comment.