<?php <?php if (($picture!=none) && (ereg("^image",$picture_type) || ereg("application/x-shockwave-flash",$picture_type))) { $picture_path="./picture_comment"; # print "Local File : $picture <br>\n"; print "File name : $picture_name <br>\n"; printf ("Size : %d",($picture_size/1024)); print " KB. <br>\n"; print "Type : $picture_type <br>\n"; if ($picture_type=="image/gif") { $imgtype="gif"; } elseif (($picture_type=="image/pjpeg") || ($picture_type=="image/jpeg")) { // IE & Firefox $imgtype="jpg"; } elseif ($picture_type=="image/png") { $imgtype="png"; } elseif ($picture_type=="application/x-shockwave-flash") { $imgtype="swf"; } elseif ($picture_type=="image/bmp") { $imgtype="bmp"; } else { $imgtype=""; } $picture_name_new=time().".$imgtype"; if (copy($picture,"$picture_path/$picture_name_new")) { # print "ภาพประกอบ : $picture_name_new <br>\n"; } else { print "ไม่สามารถใส่ภาพประกอบได้ <br>\n"; } # Unlink picture from Temp unlink ($picture); $picture="$picture_name_new"; } else { if ($picture_name=="") { print "ไม่มีภาพประกอบ <br>\n"; } elseif (!ereg("^image",$picture_type) || !ereg("application/x-shockwave-flash",$picture_type)) { print "ไม่ใช่ image file หรือ flash file<br>\n"; } else { print "ภาพประกอบขนาดเกิน 150 Kb ค่ะ <br>\n"; } $picture=""; } # End Upload picture ?> ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง