File manager - Edit - /home/webapp68.cm.in.th/u68319090021/Final/create1.php
Back
<?php include 'config.php'; ?> <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $headline = $_POST["headline"]; $content = $_POST["content"]; $uid = $_POST["uid"]; $sql = "INSERT INTO news (headline, content, time_news, uid) VALUES ('$headline', '$content', NOW(), '$uid')"; if ($conn->query($sql) === TRUE) { echo "✅ เพิ่มข่าวสำเร็จ <a href='index.php'>กลับหน้าแรก</a>"; } else { echo "❌ Error: " . $conn->error; } } ?> <h2>เพิ่มข่าวใหม่</h2> <form method="post"> หัวข้อข่าว: <input type="text" name="headline" required><br><br> เนื้อหาข่าว:<br> <textarea name="content" rows="5" cols="40" required></textarea><br><br> ผู้ประกาศ: <input type="text" name="uid" required><br><br> <input type="submit" value="บันทึกข่าว"> </form>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.39 |
proxy
|
phpinfo
|
Settings