[Help] Currency Convertor Script

by zullmi
1 replies
Hello friends i have a simple curruncy converter script which is not working now please take a look to help me where is the problem in script its giving blank page at zullmi.hosterspoint.com/converter.php

PHP Code:
<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&#8242;];
 
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>
#convertor #currency #script
  • Profile picture of the author 2WDHost
    Hi.

    1. Use ' for all single quotes and " for all double quotes.
    2. Replace
    PHP Code:
    &#8242; 
    with '
    {{ DiscussionBoard.errors[9818090].message }}

Trending Topics