<div id="bodyone"> <form action="run_admin_add.php" method="post" enctype="multipart/form-data" name="frm002"> <table border="0"><tr><td> <label>หัวข้อเรื่อง: </label></td> <td><input name="txt_subject" id="txt_subject" type="text" /></td> <br /> <tr><td><label>รูปภาพ : </label></td> <td><input type="file" name="filename"> </td> </tr> <tr> <td>เนื้อหา :</td> <td><label for="txr_content"></label> <textarea name="txr_content" id="txr_content" cols="45" rows="5"></textarea></td> </tr> <tr> <td colspan="2" align="center"> <input name="btnsave" id="btnsave" type="submit" value="Save" /> <input name="btnreset" id="btnreset" type="reset" value="Reset" /> </td> </tr> </table> </form> </div>
<? include "connect.php"; $txt_subject=$_POST['txt_subject']; if ($txt_subject==""){$txt_subject=$_GET['txt_subject'];} $txr_content=$_POST['txr_content']; if ($txr_content==""){$txr_content=$_GET['txr_content'];} ?> <? if($txt_subject=="" && $txr_content==""){ echo "กรอกข้อมูลไม่ครบครับ"; exit(); } $photo_user=$_FILES[ 'photo_user'] ['tmp_name']; $photo_user_name=$_FILES[ 'photo_user'] ['name']; $photo_user_size=$_FILES[ 'photo_user'] ['size']; $photo_user_type=$_FILES[ 'photo_user'] ['type']; $ext = strtolower (end(explode('.', $photo_user_name))); $Sql="select max(id) from learning_center"; $result=mysql_db_query($dbname,$Sql); while($r=mysql_fetch_array($result)) { $id_max=$r[0]; $filename=$id_max.".".$ext; copy($photo_user_name,"pic_user/$filename"); } $Sql="INSERT INTO learning_center(subject,content,pic) values ('$txt_subject','$txr_content','$filename')"; $query=mysql_query($Sql); echo $Sql; ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง