How to create currency converter in php

Currency converter in php

Now that you have decided to learn how to create a currency converter this is your good luck because you are in right place & you have the exact tutorial which can teach you about creating currency converter in php creating currency converter is very easy if you are going to read this article or watching the videos I am going to tell you that with this tutorial you will learn how to create a basic currency converter by using php after watching this tutorial you will be able to create a currency converter by your own self incase if you are facing any problem on creating currency converter you can use the code which you can see below or you can watch the videos for better understanding it will solve the problem.

currency converter in php

The source code for creating currency converter

<!DOCTYPE html>

<html>

<head>

<title>A Simple Converter!</title>

</head>

<body>

<form action=”converter.php” method=”post”>

<table width=”600″ align=”center” bgcolor=”skyblue”>

<tr align=”center”>

<td colspan=”4″><h2>Currency Converter</h2><td>

</tr>

<tr>

<td align=”right”><b>Enter Amount:</b></td>

<td>

<input type=”text” name=”amount” placeholder=”Enter Amount”/>

</td>

</tr>

<tr>

<td align=”right”><b>Convert from:</b></td>

<td>

<select name=”from”>

<option>Select a Currency</option>

<option>PKR</option>

<option>USD</option>

<option>AUD</option>

<option>INR</option>

<option>POUND</option>

<option>EURO</option>

</select>

</td>

</tr>

<tr>

<td align=”right”><b>Convert to:</b></td>

<td>

<select name=”to”>

<option>Select a Currency</option>

<option>EURO</option>

<option>USD</option>

<option>AUD</option>

<option>INR</option>

<option>POUND</option>

<option>PKR</option>

</select>

</td>

</tr>

<tr align=”center”>

<td colspan=”4″>

<input type=”submit” name=”convert” value=”Convert Currency”/>

</td>

</tr>

</table>

<form>

<?php

if(isset($_POST[‘convert’]))

{

$amount = $_POST[‘amount’];

$from = $_POST[‘from’];

$to = $_POST[‘to’];

 

if($from==’USD’ AND $to==’PKR’)

{

echo “<br><center><b style=’background: orange; padding: 10px;’> Your Balance is: “;

echo $amount*106;

echo “</b></center>”;

}

 

if($from==’USD’ AND $to==’POUND’)

{

echo “<br><center><b style=’background: orange; padding: 10px;’> Your Balance is: “;

echo $amount*.70;

echo “</b></center>”;

}

 

if($from==’INR’ AND $to==’PKR’)

{

echo “<br><center><b style=’background: orange; padding: 10px;’> Your Balance is: “;

echo $amount*1.55;

echo “</b></center>”;

}

 

if($from==’POUND’ AND $to==’PKR’)

{

echo “<br><center><b style=’background: orange; padding: 10px;’> Your Balance is: “;

echo $amount*180;

echo “</b></center>”;

}

 

if($from==’POUND’ AND $to==’INR’)

{

echo “<br><center><b style=’background: orange; padding: 10px;’> Your Balance is: “;

echo $amount*155;

echo “</b></center>”;

}

}

?>

</body>

</html>

Watch the video tutorial for better understanding of creating currency converter.

Click here to watch the second video

 

More Available Courses.

  • If you want to learn the complete course of php & mysqli you can learn here.
  • If you want to learn JavaScript you can learn here.
  • For learning jquery click here.
  • For learning html5 & css3 complete course click here.
  • Google blogger complete course click here to access the course.
  • How to create online voting system click here to watch the video.
  • How to create a simple calculator click here to watch the video.
  • How to create a good looking website in html5 & css3 click here to watch the video.
Please follow and like us:
1

Leave a Reply

Your email address will not be published. Required fields are marked *