"; exit(); } function fileupload($idimg, $path, $ext, $imgfile){ global $iscon; if(($ext == "jpg") || ($ext == "jpeg") || ($ext == "png")){ if($im = gdcreate($imgfile['type'], $imgfile['tmp_name'])){ jpgresize($im, 500, 500, $path, $idimg); ImageDestroy ($im); return true; } }else{ if(copy($imgfile['tmp_name'], $path.$idimg.".".$ext)) return true; } } if(isset($_POST["tb"])){ $cid=$_POST["cid"]; if($_POST["picaction"] == 1){ for($i=1; $i<=8; $i++){ if($_FILES["imggallery".$i]["size"]){ if($ext = checkext($_FILES["imggallery".$i]['name'])){ if(($ext == "jpg") || ($ext == "jpeg")){ if(!imgsize($_FILES["imggallery".$i]['size'])) isalert("ไฟล์ .".$_FILES["imggallery".$i]['name']." ใหญ่เกินไป"); if($im = gdcreate($_FILES["imggallery".$i]['type'], $_FILES["imggallery".$i]['tmp_name'])){ jpgresize($im, 500, 500, "../data/slideshow/", $_POST["imgid"]."-".$i); ImageDestroy ($im); } } } } } } if($_POST["picaction"] == 2){ if($_FILES['image']['size']){ if(!imgsize($_FILES["image"]['size'])) isalert("ไฟล์ใหญ่เกินไป"); if($ext = checkfileext($_FILES["image"]['name'])){ if(fileupload($_POST["imgid"], "../data/pic/", $ext, $_FILES["image"])){ mysql_db_query($iscon["isdbname"], "update ".$_POST["tb"]." set info_ext='".$ext."' where info_id='".$cid."'"); if($ext != $_POST["oldext"]){ if(file_exists("../data/pic/".$_POST["imgid"].".".$_POST["oldext"])) unlink("../data/pic/".$_POST["imgid"].".".$_POST["oldext"]); } } } } } $isdetail=$_POST["isdetail"]; if(empty($isdetail)) isalert("โปรดกรอกขัอความ"); if(!emptyword($isdetail)) isalert("โปรดกรอกขัอความ"); $isdetail = removetag1($isdetail); $isdetail = removetag2($isdetail); $isdetail = badword($isdetail); $isdetail = eregi_replace("
","<br />",$isdetail); $isdetail = strip_tags($isdetail, '