Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

i want to use javascript to get values from input and embed the output inside a link inside a php script

I want to use JavaScript to get values from input and embed the output inside a link inside a PHP script. I new to this JavaScript I have tried a lot of options but it ain't working. can someone help me.

<html>
<body>
<form>
<select name="currency">
<option value="btc">BTC</option>
<option value="eth">ETH</option>
</select>

<select name="currency2">
<option value="btc">BTC</option>
<option value="eth">ETH</option>
</select>
</form>
</body>
</html>

<?php
  function getPrice($url){  
    $decode = file_get_contents($url);  
      return json_decode($decode, true);
  }
  
  $btcUSD = getPrice('https://coinlib.io/api/v1/coin?key=659b81f02b22b218&pref=BTC&symbol=BTC');
  $btcPrice = $btcUSD["price"];
  $btcDisplay = $btcPrice;
  ?>
question from:https://stackoverflow.com/questions/66065332/i-want-to-use-javascript-to-get-values-from-input-and-embed-the-output-inside-a

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...