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 :)

0

1 Answer 1

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.