D
D
dev4002016-04-01 01:45:04
PHP
dev400, 2016-04-01 01:45:04

User notification by email. Is there a joint here?

Here comes the data from ajax

<?php
$model=new models_List;
$id=$_POST['id'];
$user_id = $_POST['user_id'];
$email = Models_UserData::getUserEmail($user_id);

unset($_POST['url']);
unset($_POST['id']);
unset($_POST['user_id']);



if($model->manageOrder($_POST, $id, $user_id)) {
    $response = array("msg" => "Заказ отредактирован, клиент уведомлен по Email", "status" => true);
    $model->orderNotice($email);
}

else
    $response = array("msg" => "Не удалось отредактировать заказ", "status" => false);
    echo json_encode($response);

?>

here is sending a notification to the user
if($model->manageOrder($_POST, $id, $user_id)) {
    $response = array("msg" => "Заказ отредактирован, клиент уведомлен по Email", "status" => true);
    $model->orderNotice($email);
}

if the method
$model->manageOrder
returned true, then this is how
$model->orderNotice($email);
we notify the user by email.
Is it normal to notify the user by email this way (in this part of the code)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Archakov Dennis, 2016-04-01
@archakov06

As if it's normal. But it's better to filter POST data from (XSS,SQL) injections.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question