encoded2.php - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of encoded2.php.php

  1. <?php
  2.         $key = '0A76EDD48C2D239BE4BF77B8E2E2C308';
  3.         $vector = chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0) . chr(0x0);
  4.         $encryptedString = openssl_encrypt('123-AM0712F-XK-383047820-1547628141', 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $vector);
  5.         echo 'Encrypted: '.$encryptedString."\n";
  6.         $encryptedStringBase64 = base64_encode($encryptedString);
  7.         echo 'Encrypted + base 64:'.$encryptedStringBase64."\n";
  8.  
  9.         echo 'Decrypted:'.openssl_decrypt(base64_decode($encryptedStringBase64),'aes-256-cbc',  $key, OPENSSL_RAW_DATA, $vector)."\n";
  10.             include "config/function.php";
  11.     
  12.     $q_olt_find = mysqli_query($koneksi, "SELECT * FROM tbl_olt");
  13.  
  14.     echo "<form method=post>";
  15.     echo "<label for=color>Autofind OLT</label>
  16.         <select name=OltID id=OltID>
  17.         <option value=>--- Choose a OLT ---</option>";
  18.     while ($folt = mysqli_fetch_assoc($q_olt_find))
  19.     {
  20.         if($folt['olt_id'] == $_POST['OltID'])
  21.         {
  22.             echo "<option value={$folt['olt_id']} selected>{$folt['olt_id']} | {$folt['olt_name']}</option>";
  23.         } else
  24.         {
  25.             echo "<option value={$folt['olt_id']}>{$folt['olt_id']} | {$folt['olt_name']}</option>";
  26.         }
  27.     }
  28.     echo "</select>";
  29.     echo "<input type=submit id=Find name=Find value=Find>";
  30.     echo "</form>";
  31.     $i = 0;
  32.     
  33.     if(isset($_POST['Find']))
  34.     {
  35.         $postdata = array("Find"=>isset($_POST['Find']), "OltID"=>$_POST['OltID']);
  36.         
  37.         $hasil = get_CURL('https://co-boss.smtel.co.id/autofind/api.php', $postdata);
  38.         
  39.         if($hasil["Response"] == true)
  40.         {
  41.             $i = $hasil["Total ONT Find"];
  42.     
  43.             foreach($hasil["Autofind"] as $val)
  44.             {
  45.                 foreach($val as $key => $isi)
  46.                 {
  47.                     echo $key." = ".$isi."<br />";
  48.                 }
  49.                 echo "<br />";
  50.             }
  51.             echo "<br />Jumlah ONT = ".$i;
  52.         } else
  53.         {
  54.             echo "Error : ".$hasil["Error"];
  55.         }
  56.     }
File Description
  • encoded2.php
  • PHP Code
  • 29 Aug-2023
  • 2.11 Kb
You can Share it: