Priority File Manager
📁 public_html
Base Directory:
/home/ecedu/public_html
/home/ecedu/public_html/wp-content/plugins
/home/ecedu/public_html/wp-content
/home/ecedu
/var/www
/var/www/cgi-bin
/var/www/html
public_html
/
new
/
service
/home/ecedu/public_html/new/service
Name
Type
Size
Actions
📁
..
Folder
-
Delete
Rename
📄
commentAdd.php
File
2848
Delete
Rename
Edit
Download
📄
commentRead.php
File
1326
Delete
Rename
Edit
Download
📁
images
Folder
-
Delete
Rename
📄
loadMoreNews.php
File
3073
Delete
Rename
Edit
Download
📄
session.php
File
536
Delete
Rename
Edit
Download
Upload
Create Folder
📝 Editing:
commentRead.php
Size: 1,326 bytes
Lines: 47
Type: .php
💾 Save
Cancel
✕
<?php declare(strict_types=1); ini_set('display_errors', '1'); error_reporting(E_ALL); header('Content-Type: application/json; charset=utf-8'); require_once __DIR__ . '/../Models/BasicManager.php'; try { /* 1) الاتصال */ $pdo = (new BasicManager())->getDb(); $pdo->exec("SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci"); /* 2) جلب news_id بأمان */ $newsId = filter_input(INPUT_POST, 'news_id', FILTER_VALIDATE_INT, [ 'options' => ['min_range' => 1] ]); if (!$newsId) { echo json_encode([], JSON_UNESCAPED_UNICODE); exit; } /* 3) الاستعلام */ $stmt = $pdo->prepare(" SELECT comment_id, parent_comment_id, comment, comment_sender_name, comment_sender_email, comment_at, news_id FROM dbs_comment WHERE news_id = :nid ORDER BY comment_at ASC "); $stmt->bindValue(':nid', $newsId, PDO::PARAM_INT); $stmt->execute(); /* 4) الإخراج */ echo json_encode($stmt->fetchAll(PDO::FETCH_ASSOC), JSON_UNESCAPED_UNICODE); } catch (Throwable $e) { http_response_code(500); echo json_encode(['error' => $e->getMessage()], JSON_UNESCAPED_UNICODE); }
✅ File saved successfully!