$newstype_id = $_POST['newstype']; $news_topic = $_POST['news_topic']; $news_detail = $_POST['news_detail']; $news_status = $_POST['news_status'];
<form id="form1" action="insert_news.php" method="post" enctype="multipart/form-data"> <label for="newstype">เลือกประเภทข่าว</label> <select name="newstype"> <option value="">--กรุณาเลือกประเภทข่าว--</option> <?php $sql_newstype = "SELECT * FROM tbnewstype"; $res_newstype = mysqli_query($dbcon, $sql_newstype); while ($row_newstype = mysqli_fetch_assoc($res_newstype)) { echo '<option value="'.$row_newstype['newstype_id'].'">'.$row_newstype['newstype_detail'].'</option>'; } ?> </select> <label for="news_topic">หัวข้อข่าว</label> <input type="text" name="news_topic" required> <label for="news_detail">เนื้อหาข่าว</label> <textarea name="news_detail" id="news_detail" rows="10" cols="80"> </textarea> <script> CKEDITOR.replace( 'news_detail', { language: 'th', uiColor: '#9AB8F3', width: 600 }); </script> <label for="filUpload">ไฟล์pdf</label> <input type="file" name="filUpload"><br> <label for="news_status">สถานะข่าว</label> <input type="radio" value="0" checked name="news_status">ข่าวทั่วไป <br> <input type="radio" value="1" name="news_status">ข่าวเด่น <br> <input type="submit" value="บันทึก"> </form>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง