Reputation: 11
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¤cy=1 with the variable in my URL.
For example index.php?currency=4 Have this code: {literal}{/literal}
Can you help me?
Regards, Alex :)
Upvotes: 0
Views: 175
Reputation: 120634
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¤cy=<?= $currency ?>"></script>
Upvotes: 1