403Webshell
Server IP : 172.67.187.206  /  Your IP : 172.71.28.155
Web Server : Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30
System : Windows NT WIN-ECQAAA40806 6.2 build 9200 (Windows Server 2012 Standard Edition) i586
User : SYSTEM ( 0)
PHP Version : 5.6.30
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Inetpub/www/news/edu2018/import/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /Inetpub/www/news/edu2018/import/Import_grand.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
date_default_timezone_set('Asia/Bangkok');
define('EOL',(PHP_SAPI == 'cli') ? PHP_EOL : '<br />');


if(move_uploaded_file($_FILES["filUpload"]["tmp_name"],"filexlsx/".$_FILES["filUpload"]["name"]))
{
	echo "เพิ่มข้อมูลเรียบร้อย<br>";


$urlfile="filexlsx/".$_FILES["filUpload"]["name"];
/** PHPExcel */
require_once 'PHPExcel.php';

/** PHPExcel_IOFactory - Reader */
include 'PHPExcel/IOFactory.php';


$inputFileName = "$urlfile";  
$inputFileType = PHPExcel_IOFactory::identify($inputFileName);  
$objReader = PHPExcel_IOFactory::createReader($inputFileType);  
$objReader->setReadDataOnly(true);  
$objPHPExcel = $objReader->load($inputFileName);  

$objWorksheet = $objPHPExcel->setActiveSheetIndex(0);
$highestRow = $objWorksheet->getHighestRow();
$highestColumn = $objWorksheet->getHighestColumn();

$headingsArray = $objWorksheet->rangeToArray('A1:'.$highestColumn.'1',null, true, true, true);
$headingsArray = $headingsArray[1];

$r = -1;
$namedDataArray = array();
for ($row = 2; $row <= $highestRow; ++$row) {
    $dataRow = $objWorksheet->rangeToArray('A'.$row.':'.$highestColumn.$row,null, true, true, true);
    if ((isset($dataRow[$row]['A'])) && ($dataRow[$row]['A'] > '')) {
        ++$r;
        foreach($headingsArray as $columnKey => $columnHeading) {
            $namedDataArray[$r][$columnHeading] = $dataRow[$row][$columnKey];
        }
    }
}

//echo '<pre>';
//var_dump($namedDataArray);
//echo '</pre><hr />';

//*** Connect to MySQL Database ***//
require '../config.php';

$i = 0;
foreach ($namedDataArray as $result) {
		$i++;
		$strSQL = "";
		$strSQL .= "INSERT INTO grand ";
		$strSQL .= "(stucode,tprefix,tname,tsname,tstatus,ttel1,ttel2,idcard) ";
		$strSQL .= "VALUES ";
		$strSQL .= "('".$result["รหัสนักเรียน"]."','".$result["คำนำชื่อผู้ปกครอง"]."','".$result["ชื่อผู้ปกครอง"]."','".$result["นามสกุลผู้ปกครอง"]."','".$result["สถานะ"]."','".$result["โทรศัพท์1"]."','".$result["โทรศัพท์2"]."','".$result["เลขบัตรประชาชน"]."' )";

		$mysqli->query($strSQL) or die(mysqli_error());
		
		
		echo "Row $i '".$result["รหัสนักเรียน"]."' '".$result["คำนำชื่อผู้ปกครอง"]."'...<br>";
}
//mysql_close($cn);
echo "<script language=javascript>alert('นำเข้าข้อมูลผู้ปกครองนักเรียนเรียบร้อย');</script>";
echo "<script>window.parent.location=\"../admin/student.php\"</script>";
} else {

echo "ไม่สามารถเพิ่มข้อมูลได้";
}
?>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit