Vậy mình xin post code upload đang dùng lên cho bác xem. Sau khi up xong thì với file ảnh mình có mã BBcode

và cho vào 4rum post lên thì ảnh ko hiển thị đc, mình đảm bảo là do host chứ ko do trình duyệt!
<?php
$url_dir = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['PHP_SELF']);
//upload directory.
$upload_dir = "files/";
//number of files to upload.
$num_files = 2;
//the file size in bytes.
$size_bytes =8388608; //8MB.
//Extensions you want files uploaded limited to.
$limitedext = array(".flv",".wmv",".mp3",".wav",".wma",".rar",".zip",".exe");
$mediafile = array(".flv",".wmv",".mp3",".wav",".wma");
$imagefile = array(".gif",".jpg",".jpeg",".png",".bmp");
$flashfile = array(".swf");
echo "<center>";
//check if the directory exists or not.
if (!is_dir("$upload_dir")) {
die ("Error: The directory <b>($upload_dir)</b> doesn\'t exist");
}
//check if the directory is writable.
if (!is_writeable("$upload_dir")){
die ("Error: The directory <b>($upload_dir)</b> is NOT writable, Please CHMOD (777)");
}
//if the form has been submitted, then do the upload process
//infact, if you clicked on (Upload Now!) button.
if (isset($_POST['upload_form'])){
echo "<h3>Kết quả upload:</h3>";
//do a loop for uploading files based on ($num_files) number of files.
for ($i = 1; $i <= $num_files; $i++) {
//define variables to hold the values.
$new_file = $_FILES['file'.$i];
$file_name = $new_file['name'];
//to remove spaces from file name we have to replace it with "_".
$file_name = str_replace(' ', '_', $file_name);
$file_name = str_replace('&', '-', $file_name);
$file_name = str_replace('+', '-', $file_name);
$file_name = str_replace('#', '-', $file_name);
$file_tmp = $new_file['tmp_name'];
$file_size = $new_file['size'];
#-----------------------------------------------------------#
# this code will check if the files was selected or not. #
#-----------------------------------------------------------#
if (!is_uploaded_file($file_tmp)) {
//print error message and file number.
//echo "File $i: Ko chọn.<br>";
}else{
#-----------------------------------------------------------#
# this code will check file extension #
#-----------------------------------------------------------#
$ext = strrchr($file_name,'.');
if (!in_array(strtolower($ext),$limitedext)) {
echo "File $i: ($file_name) ko đúng định dạng. <br>";
}else{
#-----------------------------------------------------------#
# this code will check file size is correct #
#-----------------------------------------------------------#
if ($file_size > $size_bytes){
echo "File $i: ($file_name) ko upload được. Dung lượng vượt quá <b>". $size_bytes / 1048576 ."</b> MB. <br>";
}else{
#-----------------------------------------------------------#
# this code check if file is Already EXISTS. #
#-----------------------------------------------------------#
if(file_exists($upload_dir.$file_name)){
echo "File $i: ($file_name) đã tồn tại.<br>";
}else{
#-----------------------------------------------------------#
# this function will upload the files. cool #
#-----------------------------------------------------------#
if (move_uploaded_file($file_tmp,$upload_dir.$file_name)){
$ext = strrchr($file_name,'.');
if (in_array(strtolower($ext),$flashfile)){
echo "File $i: <input size='30' value='[FLASH]{$url_dir}{$upload_dir}{$file_name}[/FLASH]' readonly='true' onfocus='this.select()'><br>";
}elseif (in_array(strtolower($ext),$imagefile)){
echo "File $i: <input size='30' value='[IMG]{$url_dir}{$upload_dir}{$file_name}[/IMG]' readonly='true' onfocus='this.select()'><br>";
}else{
echo "File $i: <input size='30' value='{$url_dir}{$upload_dir}{$file_name}' readonly='true' onfocus='this.select()'><br>";
}
}else{
echo "File $i: Ko upload được.<br>";
}#end of (move_uploaded_file).
}#end of (file_exists).
}#end of (file_size).
}#end of (limitedext).
}#end of (!is_uploaded_file).
}#end of (for loop).
# print back button.
echo "<br><a href=\"$_SERVER[PHP_SELF]\"><= Trở lại trang upload</a>";
}
}
echo "</center>";
?>