0

How are you? I need some help with javascript

I have this code of WHMCS (http://docs.whmcs.com/Data_Feeds): {literal}{/literal}

{literal} => Run JavaScript in WHMCS Templetes files {/literal} => Finish JavaScript

I need to change the value&currency=1 with the variable in my URL.

For example index.php?currency=4 Have this code: {literal}{/literal}

Can you help me?

Regards, Alex :)

1 Answers1

1

Something like this should do it:

<?php
    $currency = 1;

    if (isset($_REQUEST['currency']) && is_numeric($_REQUEST['currency'])) {
        $currency = intval($_REQUEST['currency']);
    }
?>

<script language="javascript" src="feeds/productsinfo.php?pid=41&get=price&billingcycle=annually&currency=<?= $currency ?>"></script>
Sean Bright
  • 118,630
  • 17
  • 138
  • 146