File manager - Edit - /home/webapp68.cm.in.th/u68319090004/Final/comments.php
Back
<!DOCTYPE html> <html lang="th"> <head> <meta charset="UTF-8"> <title>จัดการความคิดเห็น - CMS</title> <style> body { font-family: Arial, sans-serif; background: #f0f2f5; margin: 0; padding: 0; } header { background: #555; color: #fff; padding: 20px; text-align: center; } /* เปลี่ยนจาก #9c27b0 เป็น #555 */ main { max-width: 800px; margin: 20px auto; padding: 0 15px; } .comment { background: #fff; padding: 15px; border-radius: 8px; margin-bottom: 15px; box-shadow: 0 2px 6px rgba(0,0,0,0.1); position: relative; } .comment::before { content: ''; position: absolute; left: -10px; top: 15px; width: 6px; height: 6px; background: #555; border-radius: 50%; } /* เปลี่ยนจาก #9c27b0 เป็น #555 */ .comment h4 { margin: 0 0 5px; color: #333; } .comment p { margin: 5px 0; } .comment small { color: #777; } .btn { padding: 5px 10px; border: none; border-radius: 4px; cursor: pointer; margin-right: 5px; } .btn-delete { background: #f44336; color: white; } .btn-add { background: #4caf50; color: white; display: inline-block; margin-bottom: 15px; } </style> </head> <body> <header> <h1>จัดการความคิดเห็น</h1> </header> <main> <button class="btn btn-add">➕ เพิ่มความคิดเห็น</button> <?php // Array จำลองความคิดเห็น $comments = [ ['id'=>1, 'user'=>'user01', 'comment'=>'นี่คือความคิดเห็นแรก', 'date'=>'2025-08-29 10:15'], ['id'=>2, 'user'=>'admin', 'comment'=>'ความคิดเห็นจากแอดมิน', 'date'=>'2025-08-28 14:30'], ['id'=>3, 'user'=>'user02', 'comment'=>'ลองเขียน CMS ดูสนุกดี', 'date'=>'2025-08-28 16:45'], ]; foreach($comments as $c){ echo "<div class='comment'>"; echo "<h4>".htmlspecialchars($c['user'])."</h4>"; echo "<p>".htmlspecialchars($c['comment'])."</p>"; echo "<small>".$c['date']."</small><br>"; echo "<button class='btn btn-delete' onclick='return confirm(\"ลบความคิดเห็นนี้?\")'>ลบ</button>"; echo "</div>"; } ?> </main> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.82 |
proxy
|
phpinfo
|
Settings