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 $barcode = []; if(isset($_GET['print'])){ foreach($_POST["barcode"] as $id => $..

Decoded Output download

<?php  
$barcode = []; 
if(isset($_GET['print'])){  
foreach($_POST["barcode"] as $id => $val)  
{ 	 
if(intval($val) > 0){ 
for($x=0; $x < $val; $x++){ 
$barcode[$id.$x] = $_POST["code"][$id]; 
?> 
<script src="js/jquery-1.12.4.min.js"></script> 
<script> 
        window.print(); 
</script> 
<style> 
.barcode{ 
    display: inline-block; 
    border:#000 solid; 
    padding: 5px !important;!i;!; 
} 
</style> 
<div class="barcode" id="baecode_<?php echo $id.$x; ?>" data-code="<?php echo $_POST["code"][$id]; ?>"></div> 
<?php  
} 
} 
} 
}else{ ?> 
<?php require ("inc/head.php"); ?> 
<div class="container-fluid p-tb-30 flex-col-c-c"> 
<div class="pagespo"> 
<div class="3buttom" style=" display: flex; "> 
<a href="products?add" style=" float: right; " class="btn btn-rounded btn-success btn-sm addbouttom"><img style="width: 25px;" src="img/add.svg">   </a> 
<a href="cats" style=" float: right; " class="btn btn-rounded btn-primary btn-sm addbouttom"><img style="width: 25px;" src="img/cats.svg"> </a> 
<a href="brands" style=" float: right; " class="btn btn-rounded btn-primary btn-sm addbouttom"><img style="width: 25px;" src="img/brands.svg">  </a> 
<a href="barcode" style=" float: right; " class="btn btn-rounded btn-primary btn-sm addbouttom"><img style="width: 25px;" src="img/print-solid.svg">  </a> 
</div> 
<br> 
<hr> 
<form action="?print" target="print_popup"  method="post" enctype="multipart/form-data" onsubmit="window.open('about:blank','print_popup','width=1000,height=800');"> 
<input type="submit" class="btn btn-rounded btn-primary btn-sm addbouttom" value=""> 
<br> 
<table class="table table-bordered table-striped"> 
  <thead> 
    <tr> 
      <th scope="col"></th> 
      <th scope="col"> </th> 
      <th scope="col"></th> 
      <th scope="col"> </th> 
      <th scope="col"> </th> 
      <th scope="col"> </th> 
      <th scope="col"></th> 
      <th scope="col"></th> 
    </tr> 
  </thead> 
  <tbody> 
  <?php 
 
$queryx = mysqli_query($connectdb, "SELECT products.*,cats.name as ctatitle,brands.name as brandtitle FROM products LEFT JOIN cats ON products.cat = cats.id LEFT JOIN brands ON products.brand = brands.id ORDER BY id DESC");  
$xx = mysqli_num_rows($queryx);  
if($xx != 0){  
while($print = mysqli_fetch_array($queryx))  
{ 	 
$barcode[$print["id"]] = $print['barcode']; 
?>        
    <tr> 
      <td><div class="barcode" id="baecode_<?php echo $print['id']; ?>" data-code="<?php echo $print['barcode']; ?>"></div></td> 
      <td><?php echo $print['name']; ?></td> 
      <td><?php echo $print['ctatitle']; ?></td> 
      <td><?php echo $print['brandtitle']; ?></td> 
      <td><?php echo $print['prisin'] ?> </td> 
      <td><?php echo $print['prisout'] ?> </td> 
      <td><?php echo $print['qte']; ?></td> 
<td> 
<input type="hidden" name="code[<?php echo $print['id'] ?>]" value="<?php echo $print['barcode'] ?>"/> 
<input type="number" name="barcode[<?php echo $print['id'] ?>]" onfocus="this.value=''" style="width: 80px; text-align: center;" class="form-control" value="0"/> 
</td> 
</tr> 
<?php  
} 
} 
?> 
  </tbody> 
</table> 
<br> 
<input type="submit" class="btn btn-rounded btn-primary btn-sm addbouttom" value=""> 
</form> 
</div> 
</div> 
<?php require ("inc/foot.php"); ?> 
    <link rel="stylesheet" type="text/css" href="css/dataTables.bootstrap5.min.css"> 
    <link rel="stylesheet" type="text/css" href="css/bootstrap-select.min.css"> 
    <script src="js/jquery.dataTables.min.js"></script> 
    <script src="js/dataTables.bootstrap4.min.js"></script> 
	<script src='js/sweetalert2.js'></script> 
		<script src='js/sweetalert2.js'></script> 
<script src="js/bootstrap-select.min.js"></script> 
<script src="js/defaults-ar_AR.min.js"></script> 
<?php 
} 
?> 
<script type="text/javascript" src="js/jquery-barcode.min.js"></script> 
<script src="js/brcodesc.min.js"></script> 
<script> 
<?php foreach($barcode as $id => $bar){ ?> 
$("#baecode_<?php echo $id ?>").barcode("<?php echo $bar ?>","code39",{output:"svg"});     
<?php } ?> 
</script>

Did this file decode correctly?

Original Code

<?php 
$barcode = [];
if(isset($_GET['print'])){ 
foreach($_POST["barcode"] as $id => $val) 
{ 	
if(intval($val) > 0){
for($x=0; $x < $val; $x++){
$barcode[$id.$x] = $_POST["code"][$id];
?>
<script src="js/jquery-1.12.4.min.js"></script>
<script>
        window.print();
</script>
<style>
.barcode{
    display: inline-block;
    border:#000 solid;
    padding: 5px !important;!i;!;
}
</style>
<div class="barcode" id="baecode_<?php echo $id.$x; ?>" data-code="<?php echo $_POST["code"][$id]; ?>"></div>
<?php 
}
}
}
}else{ ?>
<?php require ("inc/head.php"); ?>
<div class="container-fluid p-tb-30 flex-col-c-c">
<div class="pagespo">
<div class="3buttom" style=" display: flex; ">
<a href="products?add" style=" float: right; " class="btn btn-rounded btn-success btn-sm addbouttom"><img style="width: 25px;" src="img/add.svg">   </a>
<a href="cats" style=" float: right; " class="btn btn-rounded btn-primary btn-sm addbouttom"><img style="width: 25px;" src="img/cats.svg"> </a>
<a href="brands" style=" float: right; " class="btn btn-rounded btn-primary btn-sm addbouttom"><img style="width: 25px;" src="img/brands.svg">  </a>
<a href="barcode" style=" float: right; " class="btn btn-rounded btn-primary btn-sm addbouttom"><img style="width: 25px;" src="img/print-solid.svg">  </a>
</div>
<br>
<hr>
<form action="?print" target="print_popup"  method="post" enctype="multipart/form-data" onsubmit="window.open('about:blank','print_popup','width=1000,height=800');">
<input type="submit" class="btn btn-rounded btn-primary btn-sm addbouttom" value="">
<br>
<table class="table table-bordered table-striped">
  <thead>
    <tr>
      <th scope="col"></th>
      <th scope="col"> </th>
      <th scope="col"></th>
      <th scope="col"> </th>
      <th scope="col"> </th>
      <th scope="col"> </th>
      <th scope="col"></th>
      <th scope="col"></th>
    </tr>
  </thead>
  <tbody>
  <?php

$queryx = mysqli_query($connectdb, "SELECT products.*,cats.name as ctatitle,brands.name as brandtitle FROM products LEFT JOIN cats ON products.cat = cats.id LEFT JOIN brands ON products.brand = brands.id ORDER BY id DESC"); 
$xx = mysqli_num_rows($queryx); 
if($xx != 0){ 
while($print = mysqli_fetch_array($queryx)) 
{ 	
$barcode[$print["id"]] = $print['barcode'];
?>       
    <tr>
      <td><div class="barcode" id="baecode_<?php echo $print['id']; ?>" data-code="<?php echo $print['barcode']; ?>"></div></td>
      <td><?php echo $print['name']; ?></td>
      <td><?php echo $print['ctatitle']; ?></td>
      <td><?php echo $print['brandtitle']; ?></td>
      <td><?php echo $print['prisin'] ?> </td>
      <td><?php echo $print['prisout'] ?> </td>
      <td><?php echo $print['qte']; ?></td>
<td>
<input type="hidden" name="code[<?php echo $print['id'] ?>]" value="<?php echo $print['barcode'] ?>"/>
<input type="number" name="barcode[<?php echo $print['id'] ?>]" onfocus="this.value=''" style="width: 80px; text-align: center;" class="form-control" value="0"/>
</td>
</tr>
<?php 
}
}
?>
  </tbody>
</table>
<br>
<input type="submit" class="btn btn-rounded btn-primary btn-sm addbouttom" value="">
</form>
</div>
</div>
<?php require ("inc/foot.php"); ?>
    <link rel="stylesheet" type="text/css" href="css/dataTables.bootstrap5.min.css">
    <link rel="stylesheet" type="text/css" href="css/bootstrap-select.min.css">
    <script src="js/jquery.dataTables.min.js"></script>
    <script src="js/dataTables.bootstrap4.min.js"></script>
	<script src='js/sweetalert2.js'></script>
		<script src='js/sweetalert2.js'></script>
<script src="js/bootstrap-select.min.js"></script>
<script src="js/defaults-ar_AR.min.js"></script>
<?php
}
?>
<script type="text/javascript" src="js/jquery-barcode.min.js"></script>
<script src="js/brcodesc.min.js"></script>
<script>
<?php foreach($barcode as $id => $bar){ ?>
$("#baecode_<?php echo $id ?>").barcode("<?php echo $bar ?>","code39",{output:"svg"});    
<?php } ?>
</script>

Function Calls

None

Variables

None

Stats

MD5 d057f7e6bf3f8fbe24490e3eaf92507d
Eval Count 0
Decode Time 37 ms