Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created August 14, 2017 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phpfiddle/873cc925eb590e783d9a32ed5abb2dc3 to your computer and use it in GitHub Desktop.
Save phpfiddle/873cc925eb590e783d9a32ed5abb2dc3 to your computer and use it in GitHub Desktop.
[ Posted by Harmeet ] currency converter try
<html>
<form>
<input type="text" name="currency" method="post">
<select name='cur1'>
<option value="can">Candian Dollor(AUD)</option>
<option value="USD" selected>US Dollar(USD)</option>
<option value="inr" selected>indian rupee</option>
</select>
<?php
if(isset($_GET['btn']))
{
$amount=$_GET['currency'];
if($ammount)
{echo "enter value";}
else{
$cur1=$_GET['cur1'];
if($cur1=="can" ){
echo "<center><b>Your Converted Amount is:</b><br></center>";
echo "<center>" . $amount*50 . "</center>";
}elseif($cur1=="USD" ){
echo "<center><b>Your Converted Amount is:</b><br></center>";
echo "<center>" . $amount*60 . "</center>";
}ELSEif($cur1=="inr" ){
echo "<center><b>Your Converted Amount is:</b><br></center>";
echo "<center>" . $amount*70 . "</center>";
}
}
}
?>
<input type="submit" name="btn" value="convert">
<input type="reset" name="reset" value="reset">
</form>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment