From: Alexander Smirnov Date: Tue, 12 Mar 2024 13:16:03 +0000 (+0300) Subject: if session is missing X-Git-Tag: 1.1~177^2~1 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=19fcee3670329bd0e61da0630b686f5125ae52e1;p=erp24_rep%2Fyii-erp24%2F.git if session is missing --- diff --git a/erp24/web/index.php b/erp24/web/index.php index 8af96dec..b2354ac4 100644 --- a/erp24/web/index.php +++ b/erp24/web/index.php @@ -29,7 +29,7 @@ if ( unset($postJson["_csrf"]); $post = \yii\helpers\Json::encode($postJson); $app->db->createCommand( - 'INSERT INTO page_statistics (admin_id, url, post, created_at) VALUES ("' . $_SESSION['admin_id'] . '", "' + 'INSERT INTO page_statistics (admin_id, url, post, created_at) VALUES ("' . ($_SESSION['admin_id'] ?? -1) . '", "' . $url . '", :post, NOW())' )->bindParam(':post', $post, PDO::PARAM_STR)->execute(); }