mon - 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 mon.php

  1. <?php
  2. $paymentLink = ' https://example.com/payment?project_id=0&payment_amount=100& payment_id=70872663&payment_currency=USD&signature=YWb6Z20By xpQ30hfTIjaCCsVIwVynXV%2BVLe';
  3. list('path' => $path, 'query' => $query) = parse_url($paymentLink);
  4. $pathWithParams = $path . '?' . $query;
  5. $key = 'secret';
  6. $IV = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-cbc'));
  7. $encryptedMessage = openssl_encrypt($pathWithParams, 'aes-256-cbc', $key, OPENSSL_RAW_DATA, $IV);
  8. $encryptedPath = base64_encode(base64_encode($encryptedMessage) . '::' . base64_encode($IV));
  9. $paymentHost = 'https://example.com';
  10. $projectId = 0;
  11. $paymentLinkEncrypted = "{$paymentHost}/{$projectId}/{$encryptedPath}";
  12.  
  13. echo $paymentLinkEncrypted;
  14.  
File Description
  • mon
  • PHP Code
  • 19 Oct-2021
  • 724 Bytes
You can Share it: