PHP script of ROBOKASSA does not work in WPB site

Refers to:

  • Plesk 12.0 for Linux

Created:

2016-11-16 13:10:45 UTC

Modified:

2016-12-21 20:07:35 UTC

0

Was this article helpful?


Have more questions?

Submit a request

PHP script of ROBOKASSA does not work in WPB site

Symptoms

After implementation PHP script from ROBOKASSA in Web Presence Builder site, got the following error:

    "; ?>

Script example:

<? $mrh_login = "demo"; $mrh_pass1 = "password_1"; $inv_id = 0; $inv_desc = "Пополнение счета ROBOKASSA"; $def_sum = "10"; $crc = md5("$mrh_login::$inv_id:$mrh_pass1"); print "<html><script language=JavaScript ". "src='https://auth.robokassa.ru/Merchant/PaymentForm/FormFLS.js?". "MerchantLogin=$mrh_login&DefaultSum=$def_sum&InvoiceID=$inv_id". "&Description=$inv_desc&SignatureValue=$crc'></script></html>"; ?>

Cause

PHP compiled without support of short tags <? ;?> .

More details regarding PHP tags can be found here: PHP tags

Resolution

Replace PHP tag " <? " with long " <?php " as shown on example below:

<?php
$mrh_login = "demo";
$mrh_pass1 = "password_1";
$inv_id = 0;
$inv_desc = "Техническая документация по ROBOKASSA";
$out_summ = "8.96";
$crc = md5("$mrh_login:$out_summ:$inv_id:$mrh_pass1");
print "<html><script language=JavaScript ". "src='https://auth.robokassa.ru/Merchant/PaymentForm/FormMS.js?". "MerchantLogin=$mrh_login&OutSum=$out_summ&InvoiceID=$inv_id". "&Description=$inv_desc&SignatureValue=$crc'></script></html>";
?>
Have more questions? Submit a request
Please sign in to leave a comment.