File manager - Edit - /home/webapp68.cm.in.th/u68319090021/watduangdee/admin/add_news.php
Back
<?php session_start(); if(!isset($_SESSION['admin'])){ header("Location: login.php"); } include("../config/db.php"); if(isset($_POST['save'])){ $title = $_POST['title']; $content = $_POST['content']; $conn->query("INSERT INTO news(title,content) VALUES('$title','$content')"); $success = "บันทึกข่าวเรียบร้อยแล้ว"; } ?> <!DOCTYPE html> <html lang="th"> <head> <meta charset="utf-8"> <title>เพิ่มข่าว</title> <link rel="stylesheet" href="../css/style.css"> </head> <body> <div class="container"> <h2 class="page-title">เพิ่มข่าวประชาสัมพันธ์</h2> <div class="content-box"> <?php if(isset($success)) echo "<p style='color:green'>$success</p>"; ?> <form method="post"> <input type="text" name="title" placeholder="หัวข้อข่าว" required><br><br> <textarea name="content" placeholder="รายละเอียดข่าว" rows="6" required></textarea><br><br> <button name="save">บันทึกข่าว</button> </form> <br> <a href="dashboard.php">← กลับหน้าหลังบ้าน</a> </div> </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.43 |
proxy
|
phpinfo
|
Settings