$url = 'upload/files/'.$_FILES['upload']['name']; //extensive suitability check before doing anything with the file... if (($_FILES['upload'] == "none") || (empty($_FILES['upload']['name'])) ) { $message = "No file uploaded."; } else if ($_FILES['upload']["size"] == 0) { $message = "The file is of zero length."; } else if (($_FILES['upload']["type"] != "image/pjpeg") && ($_FILES['upload']["type"] != "image/jpeg") && ($_FILES['upload']["type"] != "image/png") && ($_FILES['upload']["type"] != "image/gif")) { $message = "The image must be in either GIF , JPG or PNG format. Please upload a JPG or PNG instead."; } else if (!is_uploaded_file($_FILES['upload']["tmp_name"])) { $message = "You may be attempting to hack our server. We're on to you; expect a knock on the door sometime soon."; } else { $message = ""; $move = move_uploaded_file($_FILES['upload']['tmp_name'], $url); if(!$move) { $message = "Error moving uploaded file. Check the script is granted Read/Write/Modify permissions."; } $url = "http://www.เว็บของคุณ.com/" . $url; } if($message != "") { $url = ""; } $funcNum = $_GET['CKEditorFuncNum'] ; echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($funcNum, '$url', '$message');</script>";
$url = "http://localhost/ชื่อโฟล์เดอร์เว็บของคุณ/" . $url;
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง