Currency Converter

Started on the old forum in January 2015 · view the original in the archive · old links redirect here

#currency-calculator #currency-converter-script

4 replies · 172 views · started 11 years ago · 1 min read

4 participants
irfiii Developer · 249 posts #1

Hi Friends i am unable to understand where is problem in this please take a look if anyone can fix error

<html> <head> <title> PHP currecny Convertor</title> </head><body> <form align=’center’ action=’convertor.php’ method=’post’> Enter Amount:<input type=’text’ name=’amount’> From:<select name=’cur1′> <option>Dollar</option> <option>Pound</option> </select> To:<select name=’cur2′> <option>Indian</option> <option>PKR</option> <option>Afghani</option> </select> <input type=’submit’ name=’submit’ value=’Convert Now’> </form> <?php if(isset($_POST[‘submit’])){ $amount = $_POST[‘amount’]; $cur1 = $_POST[‘cur1′]; $cur2 = $_POST[‘cur2′]; if($cur1==”Dollar” AND $cur2==”PKR”){ echo “**Your Converted Amount is:** ”; echo “” . $amount*97.5 . “”; } if($cur1==”Dollar” AND $cur2==”Indian”){ echo “**Your Converted Amount is:** ”; echo “” . $amount*48 . “”; } if($cur1==”Dollar” AND $cur2==”Afghani”){ echo “**Your Converted Amount is:** ”; echo “” . $amount*54 . “”; } if($cur1==”Pound” AND $cur2==”PKR”){ echo “**Your Converted Amount is:** ”; echo “” . $amount*160 . “”; } if($cur1==”Pound” AND $cur2==”Indian”){ echo “**Your Converted Amount is:** ”; echo “” . $amount*120 . “”; } if($cur1==”Pound” AND $cur2==”Afghani”){ echo “**Your Converted Amount is:** ”; echo “” . $amount*100 . “”; } } ?> </body> </html>

Demo here not working http://zullmi.hosterspoint.com/converter.php

Free Web Hosting @HostersPoint.com php Hosting with Web Builder

Buy - Sell ADs ADMOLA ADs Network Monetize Your Site Traffic

Ghost Senior · 366 posts #4

try this..

<html>
<head>
<title> PHP currecny Convertor</title>
</head><body>
<form align='center' action='convertor.php' method='post'>
Enter Amount:<input type='text' name='amount'>
From:<select name='cur1'>
<option>Dollar</option>
<option>Pound</option>
</select>
To:<select name='cur2'>
<option>Indian</option>
<option>PKR</option>
<option>Afghani</option>
</select>
<input type='submit' name='submit' value='Convert Now'>
</form>
<?php
if(isset($_POST['submit'])){
$amount = $_POST['amount'];
$cur1 = $_POST['cur1'];
$cur2 = $_POST['cur2'];
if($cur1=="Dollar" AND $cur2=="PKR"){
echo "<center><b>Your Converted Amount is:</b><br></center>";
echo "<center>" . $amount*97.5 . "</center>";
}
if($cur1=="Dollar" AND $cur2=="Indian"){
echo "<center><b>Your Converted Amount is:</b><br></center>";
echo "<center>" . $amount*48 . "</center>";
}
if($cur1=="Dollar" AND $cur2=="Afghani"){
echo "<center><b>Your Converted Amount is:</b><br></center>";
echo "<center>" . $amount*54 . "</center>";
}
if($cur1=="Pound" AND $cur2=="PKR"){
echo "<center><b>Your Converted Amount is:</b><br></center>";
echo "<center>" . $amount*160 . "</center>";
}
if($cur1=="Pound" AND $cur2=="Indian"){
echo "<center><b>Your Converted Amount is:</b><br></center>";
echo "<center>" . $amount*120 . "</center>";
}
if($cur1=="Pound" AND $cur2=="Afghani"){
echo "<center><b>Your Converted Amount is:</b><br></center>";
echo "<center>" . $amount*100 . "</center>";
}
}
?>
</body>
</html>
<?php include ('Ghost'); if ($Post == true) { echo ' ![](http://destrukt.dk/ico/phpdeveloper.jpg) alt='coding-talk.com!!' />'; echo 'Sharing Is Caring!'; } else { echo ' ![](http://img98.imageshack.us/img98/6476/av3ro4.jpg) alt='the username GHOST has been comprimised!' />'; echo 'OMG SOMEBODY HELP ME!!'; } ?>
kevk3v Senior · 332 posts #5

All you need:

<?php
var_dump(json_decode(file_get_contents('http://www.freecurrencyconverterapi.com/api/v3/convert?q=USD_PKR&compact=y'), true));
?>
👍 1
Share

Mobile chat, iphone chat, android chat, chat, rooms http://www.aiochat.com

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close