Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php error_reporting(0); include "\x6b\157\x6e\145\153\x73i.p\x68\x70"; require "\x76\145..

Decoded Output download

<?php error_reporting(0); include "koneksi.php"; require "vendor/autoload.php"; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Reader\Xlsx; if(isset($_POST['upload1'])){ $nama_file_baru = 'data.xlsx'; if(is_file('tmp/'.$nama_file_baru)) unlink('tmp/'.$nama_file_baru); $path = 'tmp/' . $nama_file_baru; $ext = pathinfo($_FILES['fileexcel']['name'], PATHINFO_EXTENSION);   
$tmp_file = $_FILES['fileexcel']['tmp_name']; if($ext == "xlsx"){ move_uploaded_file($tmp_file, 'tmp/'.$nama_file_baru); $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $spreadsheet = $reader->load($path);   
$sheet = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); $numrow = 1; foreach($sheet as $row){ $idjam = $row['A']; $tingkat = $row['B']; if($numrow > 4){ mysqli_query($kon, "UPDATE siswa SET tingkat='$tingkat' 
                 
                where id_siswa='$idjam'") or die ("SQL Error: ".mysqli_error()); } $numrow++; } if(isset($hasil)){ ?> 
                             <div class="col-sm-12"> 
                              <div class="alert alert-success alert-dismissible fade show" role="alert"> 
  <strong>Berhasil</strong> Data Siswa Berhasil di Upload. 
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> 
</div> 
                           </div> 
                        <?php }else{ ?> 
                             
                              <div class="col-sm-12"> 
                              <div class="alert alert-danger alert-dismissible fade show" role="alert"> 
  <strong>Gagal</strong> Gagal Upload Data Siswa. 
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button> 
</div> 
                           </div> 
            <?php } } } ?> 
<div class="card"> 
             <div class="card-header"> 
            <i class="mr-2 bx bx-spreadsheet"></i> 
                        <strong class="card-title">Upload Siswa</strong> 
                    <a href="datasiswa.xlsx"> 
                   <button type="button" class="btn btn-danger btn-sm float-end" ><i class="bx bx-download"></i> Download Template 
                        </button> 
                   </a>      
                    </div> 
                     <div class="card-body"> 
 <form method="post" enctype="multipart/form-data" action="" class="form-horizontal"> 
                            <input name="upload1" value="upload1" hidden>            
                          <div class="row form-group"> 
                            <div class="col col-md-3"><label class=" form-control-label">Upload Data Siswa(.xlsx)</label></div> 
                            <div class="col-12 col-md-9"> 
                             
                            <input  name="fileexcel" type="file" required> 
                             
                            </div> 
                          </div> 
                           
                           
                           
                      </div> 
                      <div class="card-footer"> 
                        <button type="submit" class="btn btn-primary btn-sm"> 
                          <i class="bx bx-upload"></i> Upload 
                        </button> 
                        </form> 
                      </div><br> 
                    </div> 
                

Did this file decode correctly?

Original Code

<?php error_reporting(0); include "\x6b\157\x6e\145\153\x73i.p\x68\x70"; require "\x76\145\156\x64\157\x72/\x61\x75\x74\x6fload.\160\x68\x70"; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Reader\Xlsx; if(isset($_POST['upload1'])){ $nama_file_baru = 'data.xlsx'; if(is_file('tmp/'.$nama_file_baru)) unlink('tmp/'.$nama_file_baru); $path = 'tmp/' . $nama_file_baru; $ext = pathinfo($_FILES['fileexcel']['name'], PATHINFO_EXTENSION);  
$tmp_file = $_FILES['fileexcel']['tmp_name']; if($ext == "\170\154\163\170"){ move_uploaded_file($tmp_file, 'tmp/'.$nama_file_baru); $reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx(); $spreadsheet = $reader->load($path);  
$sheet = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); $numrow = 1; foreach($sheet as $row){ $idjam = $row['A']; $tingkat = $row['B']; if($numrow > 4){ mysqli_query($kon, "U\120\104\101\x54\105 \x73\151s\167\141 \123\x45\x54 \164\x69\x6e\147\x6b\x61\x74='$tingkat'
                
                whe\162\x65 id_\x73i\x73\167a='$idjam'") or die ("\123\121\114 \x45\x72\x72\157r: ".mysqli_error()); } $numrow++; } if(isset($hasil)){ ?>
                             <div class="col-sm-12">
                              <div class="alert alert-success alert-dismissible fade show" role="alert">
  <strong>Berhasil</strong> Data Siswa Berhasil di Upload.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
                           </div>
                        <?php }else{ ?>
                            
                              <div class="col-sm-12">
                              <div class="alert alert-danger alert-dismissible fade show" role="alert">
  <strong>Gagal</strong> Gagal Upload Data Siswa.
  <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
                           </div>
            <?php } } } ?>
<div class="card">
             <div class="card-header">
            <i class="mr-2 bx bx-spreadsheet"></i>
                        <strong class="card-title">Upload Siswa</strong>
                    <a href="datasiswa.xlsx">
                   <button type="button" class="btn btn-danger btn-sm float-end" ><i class="bx bx-download"></i> Download Template
                        </button>
                   </a>     
                    </div>
                     <div class="card-body">
 <form method="post" enctype="multipart/form-data" action="" class="form-horizontal">
                            <input name="upload1" value="upload1" hidden>           
                          <div class="row form-group">
                            <div class="col col-md-3"><label class=" form-control-label">Upload Data Siswa(.xlsx)</label></div>
                            <div class="col-12 col-md-9">
                            
                            <input  name="fileexcel" type="file" required>
                            
                            </div>
                          </div>
                          
                          
                          
                      </div>
                      <div class="card-footer">
                        <button type="submit" class="btn btn-primary btn-sm">
                          <i class="bx bx-upload"></i> Upload
                        </button>
                        </form>
                      </div><br>
                    </div>
               

Function Calls

error_reporting 1

Variables

None

Stats

MD5 1ff3270d400c79d7f4399ed7d52fe78f
Eval Count 0
Decode Time 58 ms