Saturday, October 30, 2010

JavaScript Delay Code Using setTimeout

One of the simplest ways to implement a delay in JavaScript is to use the “setTimeout” function. Actually it is the only way I would recommend as other ways may give unexpected result which I mention later in this tutorial. The catch here is that you cannot just use setTimeout on its own as you will see why later on.
The full syntax of the setTimeout function is as follows:

setTimeout("functionToCall()", 1000);

The parameters of this function are the function you plan to call and the delay in which the function should be called in milliseconds. It very important to note that the first parameter must be enclosed in quotes. If not the function is not going to work.

This code below is an example that shows an alert after waiting for five seconds

<script language="javascript">function hello(){alert("Hello, I have been delayed Five seconds");}</script><form><input type="button" value="Trigger Delay after 5 seconds" onClick="setTimeout('hello()',5000);"></form>

This is okay as long there is only one function but when you have several function working, the delay will still be there but the next function will continue to be processed without a noticeable pause.
For example in this code:
function hello(){//do some stuffsetTimeout('nextStep()',5000);// do more stuff}
Anything placed after the setTimeout function will be called even before the function “nextStep()” returns or is even called.

To simulate the sleep condition properly, with your JavaScript delay code, you can avoid this situation by running the code you intended to run after the delay from within the nextStep() function.
Here is an example to illustrate that.
function hello(){//do some stuffalert("Hello, anybody there?");setTimeout('nextStep()',5000);}function nextStep() {alert("Hello, I have been delayed Five seconds");} </script><form><input type="button" value="Run Job" onClick="hello()"></form>



Creating a PHP Countdown Timer

A countdown timer is a useful function that many like to incorporate into their websites; whether you're counting down to a company's product release, or for a personal event that is important to you such as a wedding or birthday.

Function: ‘mktime’

Creating a countdown timer is a simple task that can add a special dimension to any page or site. Countdown timers are used on sites to let the reader know how long it is until the arrival of a special event.
The creation of a countdown timer uses the ‘mktime’ function, a simple way of phrasing a time to create what is known as a ‘timestamp’.
The mktime function is always phrased in a particular sequence – as follows:
Mktime ( hour, minute, second, month, day, year, is_dst)
The first six are self explanatory, while the final is an option and refers to ‘daylight saving time’ and is represented by either a ‘1’ for yes or a ‘0’ for no, or possibly ‘-1’ representing an unknown or a default standard.
If you are really new to PHP, here are some resources for PHP novices.

The Target Date

Let us say our site is about a birthday on 25th September, 2008. We need to specify that as the ‘target’ date as follows:
$target = mktime (0, 0, 0, 9, 25, 2008);
We have left out the DST reference for simplicities sake. Note that the year is a four-digit representation – any two-digit input for year will be interpreted as 2000 onwards from 00 to 69 and 1900 onwards from 70 to 99, hence the advice that four digit years are input.



The Current Date

So, now we have our target date and time, we need to tell the countdown timer what day it is today, and there is a simple function for this:
$today = time () ;
In order for our counter to known how far it has to count, we need to tell it the difference between the target time and now, and again the command is simple:
$difference =($target-$today) ;

Converting from Seconds

It is important to remember that timestamps are measured in seconds, so we need to decide what we are counting down in. A counter can countdown in seconds, minutes, hours or days, and in our example we will aim to countdown in hours.
There are 3600 seconds in an hour, so to convert our timestamp to hours we use the following simple command:
$days =(int) ($difference/3600)
The (int) command is to make sure we are dealing in integers. We now have all of the elements of our timestamp instruction, and it reads as follows:

***<?php
$target = mktime(0, 0, 0, 9, 25, 2008) ;
$today = time () ;
$difference =($target-$today) ;
$days =(int) ($difference/3600) ;
print "My birthday will begin in $days hours";
?>***


Display Dynamic video in your website using flv player

 While uploading convert all videos into .flv format,then use the code below where you want to display video..

 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="640" height="375" id="FlvPlayer" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<param name="movie" value="http://flvplayer.com/free-flv-player/FlvPlayer.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="FFFFFF" />
<param name="FlashVars" value="flvpFolderLocation=http://flvplayer.com/free-flv-player/flvplayer/&flvpVideoSource=http://yourdomain/filename.flv&flvpWidth=640&flvpHeight=375&flvpInitVolume=50&flvpTurnOnCorners=true&flvpBgColor=FFFFFF"
<embed src="http://flvplayer.com/free-flv-player/FlvPlayer.swf" flashvars="flvpFolderLocation=http://flvplayer.com/free-flv-player/flvplayer/&flvpVideoSource=http:/http://yourdomain/filename..flv&flvpWidth=640&flvpHeight=375&flvpInitVolume=50&flvpTurnOnCorners=true&flvpBgColor=FFFFFF" quality="high" bgcolor="FFFFFF" width="640" height="375" name="FlvPlayer" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
      

Friday, October 29, 2010

Limit number of selections in a Multiple Select Box

Call this function on select box 's onchange event..

<script type="text/javascript">

<!--//   LIMIT MULTIPLE SELECTED OPTIONS SCRIPT || 01-21-2005   \\;
var selectedOptions = []; // Written by: WillyDuitt@hotmail.com \\;
 function countSelected(select,maxNumber){
   for(var i=0; i<select.options.length; i++){
     if(select.options[i].selected && !new RegExp(i,'g').test(selectedOptions.toString())){
        selectedOptions.push(i);
     }

     if(!select.options[i].selected && new RegExp(i,'g').test(selectedOptions.toString())){
      selectedOptions = selectedOptions.sort(function(a,b){return a-b}); 
       for(var j=0;j<selectedOptions.length; j++){
         if(selectedOptions[j] == i){
            selectedOptions.splice(j,1);
         }
       }
     }

     if(selectedOptions.length > maxNumber)
     {
        alert('You may only choose '+maxNumber+' options!!');
           for(var i=0; i<select.options.length; i++){

        select.options[i].selected = false;
        selectedOptions.pop();
        }
      
        document.body.focus();        return true;
     } 
   }   
 }
</script>

Thursday, October 28, 2010

Upload video and convert it to flv in php and cut their thumnail

<?php

set_time_limit(0);

define('ffmpeg', '/usr/bin/ffmpeg');

define('FFMPEG_BINARY', '/usr/bin/ffmpeg');

define('FFMPEG_movie', '/usr/bin/ffmpeg_movie');

define('flvtool2Path', '/usr/bin/flvtool2');





$submit=$_POST['submitted']; //Get value form submitted Field

$video_file=$_FILES['vfile']; // Uploaded video file

$videoTitle=$_REQUEST['vTitle']; // upload file title



if(isset($submit)){

function getName($name){


$type=$name;

$type = str_replace( ' ', '_', $type );

return($type);

}



function getImageName($name){

$occur=strrpos($name,'.');

//echo $occur;

$name=substr($name,0,$occur);

return($name);

}



function getFileExtension($fileName){



$fileNameParts = explode( ".", $fileName );


$fileExtension = end( $fileNameParts );


$fileExtension = strtolower( $fileExtension );


return($fileExtension);


}


$videoDirName=$_SERVER['DOCUMENT_ROOT']."/files/video/video/"; //Folder name where video will save


$videoThumDir=$_SERVER['DOCUMENT_ROOT']."/files/video/thum/"; //folder name for where upload video cut thum will save



$newFileName=getName(getImageName($_FILES['videoUpload']['name'])); //Get new file for video file will save ith that name

$destinationThum=$videoThumDir.getName(getImageName($_FILES['videoUpload']['name'])).'.jpg'; // complete path for save video cut thum



if(getFileExtension($_FILES['videoUpload']['name'])!="flv"){

$tempUpload=$_SERVER['DOCUMENT_ROOT']."/totalbhakti/files/video/temp/".$newFileName.'.'.getFileExtension($_FILES['videoUpload']['name']);

}else{

$tempUpload=$destinationVideo;



}


function create_thumbnail($source,$destination,$thum_width,$thum_height){

//echo $source.'<br>';

$size=getimagesize($source);

//echo $size[0];

$width=$size[0];

echo 'width-'.$width;

$height=$size[1];

$x=0;

$y=0;

/*if($width>$height){

$x=ceil(($width-$height)/2);

$width=$height;

}if($width<$height){

$x=ceil(($height-$width)/2);

$height=$width;

}*/

echo '<br>'.$thum_width.'--'.$thum_height;

$new_image=imagecreatetruecolor($thum_width,$thum_height)or die('Cannot Initialize new GD image stream');

$extension=getExtension($source);

echo '<br>Exten:-'.$extension.'<br>';


if($extension=='jpg'||$extension=='jpeg'){


$image=imagecreatefromjpeg($source);

}



imagecopyresampled($new_image,$image,0,0,$x,$y,$thum_width,$thum_height,$width,$height);


if($extension=='jpg'||$extension=='jpeg'){


imagejpeg($new_image,$destination,40);
}

}

function getExtension($name){



return('jpg');
}

if(move_uploaded_file($_FILES['videoUpload']['tmp_name'],$tempUpload)){

shell_exec("ffmpeg -i $tempUpload -ar 22050 -ab 32 -f flv -s 450×370 $destinationVideo");

$img=shell_exec("ffmpeg -i $destinationVideo -f mjpeg -t 0.050 $destinationThum");
create_thumbnail($destinationThum,$destinationFirstThum,124,100);
$mov = new ffmpeg_movie($destinationVideo);
$totTime=ceil($mov->getDuration());
$fps=$mov->getFrameRate();
echo '<div style="height:150px; display:block; border:#006600 solid 2px; height:20px; background-color:#66CC99 ">
Your Video Information<br>Uploaded Video Length:-'.($totTime/60).'</div><br>';
}else{
echo 'not uploaded';
}
}

if ($_FILES['videoUpload']['error'] > 0) {

echo '<p class="error">The file could not be uploaded because: <strong>';

switch ($_FILES['videoUpload']['error']) {
case 1:
echo 'The file exceeds the upload_max_filesize setting in php.ini.';
break;

case 2:
echo 'The file exceeds the MAX_FILE_SIZE setting in the HTML form.';
break;

case 3:
echo 'The file was only partially uploaded.';
break;


case 4:

echo 'No file was uploaded.';
break;

case 6:
echo 'No temporary folder was available.';
break;

case 7:
echo 'Unable to write to the disk.';
break;

case 8:
echo 'File upload stopped.';
break;



default:
echo 'A system error occurred.'.$_FILES['videoUpload']['error'];
break;
}
echo '</strong></p>';
}
}
?>
<form id="form1" name="form1" enctype="multipart/form-data" method="post" action="">

<table width="688" border="1" align="center" cellpadding="5" cellspacing="5">
<tr>
<td width="300"><div align="left"><strong>Select Video for Upload </strong></div></td>
<td width="196"><div align="center"><label>
<input name="vfile" type="file" id="vfile" />
<input name="submitted" type="hidden" id="submitted" value="true" /></label>
</div></td></tr><tr>
<td><div align="left"><strong>Enter Title for Video </strong></div></td>
<td>
<label><input name="vTitle" type="text" id="vTitle" size="40" /></label>
</td></tr><tr><td>
<label><input type="submit" name="Submit" value="Submit" /></label></td>
<td>&nbsp;</td>
</tr>
</table>
</form>

Implement Currency conversion in php with ajax

This will help to attach a world class api to your web page to calculate currency conversion at your end using ajax.

Code:-


<script type="text/javascript" src="http://currencyconverter.55uk.net/currency_converter_json.js"></script>
<script type="text/javascript">
function getMyRate(jData) {
if (jData == null) {
alert("There was a problem parsing search results.");
return;
}
var myval = jData.ResultSet;
var mydiv = jData.xxMyDiv;
document.getElementById(mydiv).innerHTML = myval;
}


</script>



<form method="post" action="currencyConvert.php">
<table align="center" width="500px" style="border:#CCCCCC solid 1px;">
<tr>
<td align="center" bgcolor="#E9E9E9">
<strong>Currency Conversion From one To other</strong><input type="hidden" name="act" value="true" />
</td>
</tr>
<tr>
<td align="left"><strong>Enter Amount</strong><br /><input type="text" size="10" name="amt" /></td>
</tr>
<tr>
<td>
<strong> Select Curreny Country from </strong><br />
<select name="From" size="4">
<option selected="selected" value="AFN">Afghanistan, Afghani (AFN)</option>
<option value="ALL">Albania, Lek (ALL)</option>
<option value="DZD">Algeria, Dinar (DZD)</option>
<option value="USD">America (United States), Dollar (USD)</option>
<option value="USD">American Samoa, United States Dollar (USD)</option>
<option value="EUR">Andorra, Euro (EUR)</option>
<option value="AOA">Angola, Kwanza (AOA)</option>
<option value="XCD">Anguilla, East Caribbean Dollar (XCD)</option>
<option value="XCD">Antigua and Barbuda, East Caribbean Dollar (XCD)</option>
<option value="ARS">Argentina, Peso (ARS)</option>
<option value="AMD">Armenia, Dram (AMD)</option>
<option value="AWG">Aruba, Guilder (AWG)</option>
<option value="AUD">Ashmore and Cartier Islands, Australia Dollar (AUD)</option>
<option value="AUD">Australia, Dollar (AUD)</option>
<option value="EUR">Austria, Euro (EUR)</option>
<option value="AZN">Azerbaijan, New Manat (AZN)</option>
<option value="EUR">Azores, Euro (EUR)</option>
<option value="BSD">Bahamas, Dollar (BSD)</option>
<option value="BHD">Bahrain, Dinar (BHD)</option>
<option value="BBD">Bajan (Barbados), Dollar (BBD)</option>
<option value="EUR">Balearic Islands, Euro (EUR)</option>
<option value="BDT">Bangladesh, Taka (BDT)</option>
<option value="BBD">Barbados, Dollar (BBD)</option>
<option value="BYR">Belarus, Ruble (BYR)</option>
<option value="EUR">Belgium, Euro (EUR)</option>
<option value="BZD">Belize, Dollar (BZD)</option>
<option value="XOF">Benin, CFA Franc BCEAO (XOF)</option>
<option value="BMD">Bermuda, Dollar (BMD)</option>
<option value="INR">Bhutan, India Rupee (INR)</option>
<option value="BTN">Bhutan, Ngultrum (BTN)</option>
<option value="BOB">Bolivia, Boliviano (BOB)</option>
<option value="ANG">Bonaire, Netherlands Antilles Guilder (ANG)</option>
<option value="BAM">Bosnia and Herzegovina, Convertible Marka (BAM)</option>
<option value="BWP">Botswana, Pula (BWP)</option>
<option value="BRL">Brazil, Real (BRL)</option>
<option value="GBP">Britain (United Kingdom), Pound (GBP)</option>
<option value="GBP">British Indian Ocean Territory, United Kingdom Pound (GBP)</option>
<option value="USD">British Indian Ocean Territory, United States Dollar (USD)</option>
<option value="USD">British Virgin Islands, United States Dollar (USD)</option>
<option value="BND">Brunei, Dollar (BND)</option>
<option value="SGD">Brunei, Singapore Dollar (SGD)</option>
<option value="BGN">Bulgaria, Lev (BGN)</option>
<option value="XOF">Burkina Faso, CFA Franc BCEAO (XOF)</option>
<option value="MMK">Burma (Myanmar), Kyat (MMK)</option>
<option value="BIF">Burundi, Franc (BIF)</option>
<option value="KHR">Cambodia, Riel (KHR)</option>
<option value="XAF">Cameroon, CFA Franc BEAC (XAF)</option>
<option value="CAD">Canada, Dollar (CAD)</option>
<option value="EUR">Canary Islands, Euro (EUR)</option>
<option value="CVE">Cape Verde, Escudo (CVE)</option>
<option value="KYD">Cayman Islands, Dollar (KYD)</option>
<option value="XAF">Central African Republic, CFA Franc BEAC (XAF)</option>
<option value="XAF">CFA Communauté Financière Africaine BEAC Franc (XAF)</option>
<option value="XOF">CFA Communauté Financière Africaine BCEAO Franc (XOF)</option>
<option value="XAF">Chad, CFA Franc BEAC (XAF)</option>
<option value="CLP">Chile, Peso (CLP)</option>
<option value="CNY">China, Yuan Renminbi (CNY)</option>
<option value="AUD">Christmas Island, Australia Dollar (AUD)</option>
<option value="AUD">Cocos (Keeling Islands, Australia Dollar (AUD)</option>
<option value="COP">Colombia, Peso (COP)</option>
<option value="XAF">Communauté Financière Africaine BEAC Franc (XAF)</option>
<option value="XOF">Communauté Financière Africaine BCEAO Franc (XOF)</option>
<option value="KMF">Comoros, Franc (KMF)</option>
<option value="XPF">Comptoirs Français du Pacifique Franc (XPF)</option>
<option value="XAF">Congo/Brazzaville, CFA Franc BEAC (XAF)</option>
<option value="CDF">Congo/Kinshasa, Franc (CDF)</option>
<option value="NZD">Cook Islands, New Zealand Dollar (NZD)</option>
<option value="AUD">Coral Sea Islands, Australia Dollar (AUD)</option>
<option value="CRC">Costa Rica, Colon (CRC)</option>
<option value="XOF">Côte d'Ivoire, CFA Franc BCEAO (XOF)</option>
<option value="HRK">Croatia, Kuna (HRK)</option>
<option value="CUC">Cuba, Convertible Peso (CUC)</option>
<option value="CUP">Cuba, Peso (CUP)</option>
<option value="ANG">Curaço, Netherlands Antilles Guilder (ANG)</option>
<option value="EUR">Cyprus, Euro (EUR)</option>
<option value="CZK">Czech Republic, Koruna (CZK)</option>
<option value="DKK">Denmark, Krone (DKK)</option>
<option value="DJF">Djibouti, Franc (DJF)</option>
<option value="XCD">Dominica, East Caribbean Dollar (XCD)</option>
<option value="DOP">Dominican Republic, Peso (DOP)</option>
<option value="EUR">Dutch (Netherlands), Euro (EUR)</option>
<option value="XCD">East Caribbean Dollar (XCD)</option>
<option value="USD">East Timor, United States Dollar (USD)</option>
<option value="USD">Ecuador, United States Dollar (USD)</option>
<option value="EGP">Egypt, Pound (EGP)</option>
<option value="SVC">El Salvador, Colon (SVC)</option>
<option value="USD">El Salvador, United States Dollar (USD)</option>
<option value="GBP">England (United Kingdom), Pound (GBP)</option>
<option value="XAF">Equatorial Guinea, CFA Franc BEAC (XAF)</option>
<option value="ERN">Eritrea, Nakfa (ERN)</option>
<option value="EEK">Estonia, Kroon (EEK)</option>
<option value="ETB">Ethiopia, Birr (ETB)</option>
<option value="EUR">Euro (EUR)</option>
<option value="EUR">Europa Island, Euro (EUR)</option>
<option value="FKP">Falkland Islands, Pound (FKP)</option>
<option value="DKK">Faroe Islands, Denmark Krone (DKK)</option>
<option value="FJD">Fiji, Dollar (FJD)</option>
<option value="EUR">Finland, Euro (EUR)</option>
<option value="EUR">France, Euro (EUR)</option>
<option value="EUR">French Guiana, Euro (EUR)</option>
<option value="XPF">French Polynesia, Comptoirs Français du Pacifique Franc (XPF)</option>
<option value="EUR">French Southern and Antarctic Lands, Euro (EUR)</option>
<option value="XAF">Gabon, CFA Franc BEAC (XAF)</option>
<option value="GMD">Gambia, Dalasi (GMD)</option>
<option value="ILS">Gaza Strip, Israel New Shekel (ILS)</option>
<option value="GEL">Georgia, Lari (GEL)</option>
<option value="EUR">Germany, Euro (EUR)</option>
<option value="GHS">Ghana, Cedi (GHS)</option>
<option value="GIP">Gibraltar, Pound (GIP)</option>
<option value="XAU">Gold Ounce (XAU)</option>
<option value="GBP">Great Britain (United Kingdom), Pound (GBP)</option>
<option value="EUR">Greece, Euro (EUR)</option>
<option value="DKK">Greenland, Denmark Krone (DKK)</option>
<option value="XCD">Grenada, East Caribbean Dollar (XCD)</option>
<option value="EUR">Guadeloupe, Euro (EUR)</option>
<option value="USD">Guam, United States Dollar (USD)</option>
<option value="GTQ">Guatemala, Quetzal (GTQ)</option>
<option value="GGP">Guernsey, Pound (GGP)</option>
<option value="GNF">Guinea, Franc (GNF)</option>
<option value="XOF">Guinea-Bissau, CFA Franc BCEAO (XOF)</option>
<option value="GYD">Guyana, Dollar (GYD)</option>
<option value="HTG">Haiti, Gourde (HTG)</option>
<option value="EUR">Holland (Netherlands), Euro (EUR)</option>
<option value="EUR">Holy See (Vatican City), Euro (EUR)</option>
<option value="HNL">Honduras, Lempira (HNL)</option>
<option value="HKD">Hong Kong, Dollar (HKD)</option>
<option value="HUF">Hungary, Forint (HUF)</option>
<option value="ISK">Iceland, Krona (ISK)</option>
<option value="INR">India, Rupee (INR)</option>
<option value="IDR">Indonesia, Rupiah (IDR)</option>
<option value="XDR">International Monetary Fund Special Drawing Right (XDR)</option>
<option value="IRR">Iran, Rial (IRR)</option>
<option value="IQD">Iraq, Dinar (IQD)</option>
<option value="EUR">Ireland, Euro (EUR)</option>
<option value="FKP">Islas Malvinas (Falkland Islands), Pound (FKP)</option>
<option value="IMP">Isle of Man, Pound (IMP)</option>
<option value="ILS">Israel, New Shekel (ILS)</option>
<option value="EUR">Italy, Euro (EUR)</option>
<option value="XOF">Ivory Coast (Côte d'Ivoire), CFA Franc BCEAO (XOF)</option>
<option value="JMD">Jamaica, Dollar (JMD)</option>
<option value="JPY">Japan, Yen (JPY)</option>
<option value="JEP">Jersey, Pound (JEP)</option>
<option value="USD">Johnson, United States Dollar (USD)</option>
<option value="JOD">Jordan, Dinar (JOD)</option>
<option value="EUR">Juan de Nova, Euro (EUR)</option>
<option value="KZT">Kazakhstan, Tenge (KZT)</option>
<option value="KES">Kenya, Shilling (KES)</option>
<option value="AUD">Kiribati, Australia Dollar (AUD)</option>
<option value="KWD">Kuwait, Dinar (KWD)</option>
<option value="KGS">Kyrgyzstan, Som (KGS)</option>
<option value="LAK">Laos, Kip (LAK)</option>
<option value="LVL">Latvia, Lat (LVL)</option>
<option value="LBP">Lebanon, Pound (LBP)</option>
<option value="LSL">Lesotho, Loti (LSL)</option>
<option value="LRD">Liberia, Dollar (LRD)</option>
<option value="LYD">Libya, Dinar (LYD)</option>
<option value="CHF">Liechtenstein, Switzerland Franc (CHF)</option>
<option value="LTL">Lithuania, Litas (LTL)</option>
<option value="EUR">Luxembourg, Euro (EUR)</option>
<option value="MOP">Macau, Pataca (MOP)</option>
<option value="MKD">Macedonia, Denar (MKD)</option>
<option value="MGA">Madagascar, Ariary (MGA)</option>
<option value="EUR">Madeira Islands, Euro (EUR)</option>
<option value="MWK">Malawi, Kwacha (MWK)</option>
<option value="MYR">Malaysia, Ringgit (MYR)</option>
<option value="MVR">Maldives, Rufiyaa (MVR)</option>
<option value="XOF">Mali, CFA Franc BCEAO (XOF)</option>
<option value="EUR">Malta, Euro (EUR)</option>
<option value="FKP">Malvinas (Falkland Islands), Pound (FKP)</option>
<option value="USD">Marshall Islands, United States Dollar (USD)</option>
<option value="EUR">Martinique, Euro (EUR)</option>
<option value="MRO">Mauritania, Ouguiya (MRO)</option>
<option value="MUR">Mauritius, Rupee (MUR)</option>
<option value="EUR">Mayotte, Euro (EUR)</option>
<option value="MXN">Mexico, Peso (MXN)</option>
<option value="USD">Micronesia, United States Dollar (USD)</option>
<option value="USD">Midway Islands, United States Dollar (USD)</option>
<option value="MDL">Moldova, Leu (MDL)</option>
<option value="EUR">Monaco, Euro (EUR)</option>
<option value="MNT">Mongolia, Tughrik (MNT)</option>
<option value="EUR">Montenegro, Euro (EUR)</option>
<option value="XCD">Montserrat, East Caribbean Dollar (XCD)</option>
<option value="MAD">Morocco, Dirham (MAD)</option>
<option value="MZN">Mozambique, Metical (MZN)</option>
<option value="MMK">Myanmar (Burma), Kyat (MMK)</option>
<option value="NAD">Namibia, Dollar (NAD)</option>
<option value="AUD">Nauru, Australia Dollar (AUD)</option>
<option value="HTG">Navassa, Haiti Gourde (HTG)</option>
<option value="USD">Navassa, United States Dollar (USD)</option>
<option value="NPR">Nepal, Rupee (NPR)</option>
<option value="ANG">Netherlands Antilles, Guilder (ANG)</option>
<option value="EUR">Netherlands, Euro (EUR)</option>
<option value="XPF">New Caledonia, Comptoirs Français du Pacifique Franc (XPF)</option>
<option value="NZD">New Zealand, Dollar (NZD)</option>
<option value="NIO">Nicaragua, Cordoba (NIO)</option>
<option value="XOF">Niger, CFA Franc BCEAO (XOF)</option>
<option value="NGN">Nigeria, Naira (NGN)</option>
<option value="NZD">Niue, New Zealand Dollar (NZD)</option>
<option value="AUD">Norfolk Island, Australia Dollar (AUD)</option>
<option value="KPW">North Korea, Won (KPW)</option>
<option value="USD">Northern Mariana Islands, United States Dollar (USD)</option>
<option value="NOK">Norway, Krone (NOK)</option>
<option value="OMR">Oman, Rial (OMR)</option>
<option value="PKR">Pakistan, Rupee (PKR)</option>
<option value="USD">Palau, United States Dollar (USD)</option>
<option value="XPD">Palladium Ounce (XPD)</option>
<option value="PAB">Panama, Balboa (PAB)</option>
<option value="USD">Panama, United States Dollar (USD)</option>
<option value="PGK">Papua New Guinea, Kina (PGK)</option>
<option value="CNY">Paracel Islands, China Yuan Renminbi (CNY)</option>
<option value="VND">Paracel Islands, Vietnam Dong (VND)</option>
<option value="PYG">Paraguay, Guarani (PYG)</option>
<option value="PEN">Peru, Nuevo Sol (PEN)</option>
<option value="PHP">Philippines, Peso (PHP)</option>
<option value="NZD">Pitcairn, New Zealand Dollar (NZD)</option>
<option value="XPT">Platinum Ounce (XPT)</option>
<option value="PLN">Poland, Zloty (PLN)</option>
<option value="EUR">Portugal, Euro (EUR)</option>
<option value="USD">Puerto Rico, United States Dollar (USD)</option>
<option value="QAR">Qatar, Riyal (QAR)</option>
<option value="EUR">Réunion, Euro (EUR)</option>
<option value="RON">Romania, New Leu (RON)</option>
<option value="RUB">Russia, Ruble (RUB)</option>
<option value="RWF">Rwanda, Franc (RWF)</option>
<option value="ANG">Saba, Netherlands Antilles Guilder (ANG)</option>
<option value="SHP">Saint Helena, Pound (SHP)</option>
<option value="XCD">Saint Kitts and Nevis, East Caribbean Dollar (XCD)</option>
<option value="XCD">Saint Lucia, East Caribbean Dollar (XCD)</option>
<option value="EUR">Saint Pierre and Miquelon, Euro (EUR)</option>
<option value="XCD">Saint Vincent and The Grenadines, East Caribbean Dollar (XCD)</option>
<option value="EUR">Saint-Martin, Euro (EUR)</option>
<option value="WST">Samoa, Tala (WST)</option>
<option value="EUR">San Marino, Euro (EUR)</option>
<option value="STD">São Tome and Principe, Dobra (STD)</option>
<option value="SAR">Saudi Arabia, Riyal (SAR)</option>
<option value="GBP">Scotland (United Kingdom), Pound (GBP)</option>
<option value="SPL">Seborga, Luigino (SPL)</option>
<option value="XOF">Senegal, CFA Franc BCEAO (XOF)</option>
<option value="RSD">Serbia, Dinar (RSD)</option>
<option value="SCR">Seychelles, Rupee (SCR)</option>
<option value="SLL">Sierra Leone, Leone (SLL)</option>
<option value="XAG">Silver Ounce (XAG)</option>
<option value="SGD">Singapore, Dollar (SGD)</option>
<option value="ANG">Sint Eustatius, Netherlands Antilles Guilder (ANG)</option>
<option value="ANG">Sint Maarten, Netherlands Antilles Guilder (ANG)</option>
<option value="EUR">Slovakia, Euro (EUR)</option>
<option value="EUR">Slovenia, Euro (EUR)</option>
<option value="SBD">Solomon Islands, Dollar (SBD)</option>
<option value="SOS">Somalia, Shilling (SOS)</option>
<option value="ZAR">South Africa, Rand (ZAR)</option>
<option value="GBP">South Georgia, United Kingdom Pound (GBP)</option>
<option value="KRW">South Korea, Won (KRW)</option>
<option value="GBP">South Sandwich Islands, United Kingdom Pound (GBP)</option>
<option value="EUR">Spain, Euro (EUR)</option>
<option value="LKR">Sri Lanka, Rupee (LKR)</option>
<option value="SDG">Sudan, Pound (SDG)</option>
<option value="SRD">Suriname, Dollar (SRD)</option>
<option value="NOK">Svalbard and Jan Mayen, Norway Krone (NOK)</option>
<option value="SZL">Swaziland, Lilangeni (SZL)</option>
<option value="ZAR">Swaziland, South Africa Rand (ZAR)</option>
<option value="SEK">Sweden, Krona (SEK)</option>
<option value="CHF">Switzerland, Franc (CHF)</option>
<option value="SYP">Syria, Pound (SYP)</option>
<option value="TWD">Taiwan, New Dollar (TWD)</option>
<option value="TJS">Tajikistan, Somoni (TJS)</option>
<option value="RUB">Tajikistan, Russia Ruble (RUB)</option>
<option value="TZS">Tanzania, Shilling (TZS)</option>
<option value="THB">Thailand, Baht (THB)</option>
<option value="XOF">Togo, CFA Franc BCEAO (XOF)</option>
<option value="NZD">Tokelau, New Zealand Dollar (NZD)</option>
<option value="TOP">Tonga, Pa'anga (TOP)</option>
<option value="MDL">Transnistria, Moldova Leu (MDL)</option>
<option value="TTD">Trinidad and Tobago, Dollar (TTD)</option>
<option value="TND">Tunisia, Dinar (TND)</option>
<option value="TRY">Turkey, Lira (TRY)</option>
<option value="TMT">Turkmenistan, New Manat (TMT)</option>
<option value="TMM">Turkmenistan, Manat (TMM)</option>
<option value="USD">Turks and Caicos Islands, United States Dollar (USD)</option>
<option value="AUD">Tuvalu, Australia Dollar (AUD)</option>
<option value="TVD">Tuvalu, Dollar (TVD)</option>
<option value="UGX">Uganda, Shilling (UGX)</option>
<option value="UAH">Ukraine, Hryvna (UAH)</option>
<option value="AED">United Arab Emirates, Dirham (AED)</option>
<option value="GBP">United Kingdom, Pound (GBP)</option>
<option value="USD">United States, Dollar (USD)</option>
<option value="UYU">Uruguay, Peso (UYU)</option>
<option value="UZS">Uzbekistan, Som (UZS)</option>
<option value="VUV">Vanuatu, Vatu (VUV)</option>
<option value="EUR">Vatican City, Euro (EUR)</option>
<option value="VEF">Venezuela, Bolivar Fuerte (VEF)</option>
<option value="VND">Vietnam, Dong (VND)</option>
<option value="USD">Virgin Islands, United States Dollar (USD)</option>
<option value="USD">Wake Island, United States Dollar (USD)</option>
<option value="XPF">Wallis and Futuna Islands, Comptoirs Français du Pacifique Franc (XPF)</option>
<option value="ILS">West Bank, Israel New Shekel (ILS)</option>
<option value="JOD">West Bank, Jordan Dinar (JOD)</option>
<option value="MAD">Western Sahara, Morocco Dirham (MAD)</option>
<option value="WST">Samoa, Tala (WST)</option>
<option value="YER">Yemen, Rial (YER)</option>
<option value="ZMK">Zambia, Kwacha (ZMK)</option>
<option value="ZWD">Zimbabwe, Dollar (ZWD)</option>
</select>
</td>
</tr>
<tr>
<td>
<strong> Select Curreny Country To </strong><br />
<select name="to" size="4">
<option selected="selected" value="AFN">Afghanistan, Afghani (AFN)</option>
<option value="ALL">Albania, Lek (ALL)</option>
<option value="DZD">Algeria, Dinar (DZD)</option>
<option value="USD">America (United States), Dollar (USD)</option>
<option value="USD">American Samoa, United States Dollar (USD)</option>
<option value="EUR">Andorra, Euro (EUR)</option>
<option value="AOA">Angola, Kwanza (AOA)</option>
<option value="XCD">Anguilla, East Caribbean Dollar (XCD)</option>
<option value="XCD">Antigua and Barbuda, East Caribbean Dollar (XCD)</option>
<option value="ARS">Argentina, Peso (ARS)</option>
<option value="AMD">Armenia, Dram (AMD)</option>
<option value="AWG">Aruba, Guilder (AWG)</option>
<option value="AUD">Ashmore and Cartier Islands, Australia Dollar (AUD)</option>
<option value="AUD">Australia, Dollar (AUD)</option>
<option value="EUR">Austria, Euro (EUR)</option>
<option value="AZN">Azerbaijan, New Manat (AZN)</option>
<option value="EUR">Azores, Euro (EUR)</option>
<option value="BSD">Bahamas, Dollar (BSD)</option>
<option value="BHD">Bahrain, Dinar (BHD)</option>
<option value="BBD">Bajan (Barbados), Dollar (BBD)</option>
<option value="EUR">Balearic Islands, Euro (EUR)</option>
<option value="BDT">Bangladesh, Taka (BDT)</option>
<option value="BBD">Barbados, Dollar (BBD)</option>
<option value="BYR">Belarus, Ruble (BYR)</option>
<option value="EUR">Belgium, Euro (EUR)</option>
<option value="BZD">Belize, Dollar (BZD)</option>
<option value="XOF">Benin, CFA Franc BCEAO (XOF)</option>
<option value="BMD">Bermuda, Dollar (BMD)</option>
<option value="INR">Bhutan, India Rupee (INR)</option>
<option value="BTN">Bhutan, Ngultrum (BTN)</option>
<option value="BOB">Bolivia, Boliviano (BOB)</option>
<option value="ANG">Bonaire, Netherlands Antilles Guilder (ANG)</option>
<option value="BAM">Bosnia and Herzegovina, Convertible Marka (BAM)</option>
<option value="BWP">Botswana, Pula (BWP)</option>
<option value="BRL">Brazil, Real (BRL)</option>
<option value="GBP">Britain (United Kingdom), Pound (GBP)</option>
<option value="GBP">British Indian Ocean Territory, United Kingdom Pound (GBP)</option>
<option value="USD">British Indian Ocean Territory, United States Dollar (USD)</option>
<option value="USD">British Virgin Islands, United States Dollar (USD)</option>
<option value="BND">Brunei, Dollar (BND)</option>
<option value="SGD">Brunei, Singapore Dollar (SGD)</option>
<option value="BGN">Bulgaria, Lev (BGN)</option>
<option value="XOF">Burkina Faso, CFA Franc BCEAO (XOF)</option>
<option value="MMK">Burma (Myanmar), Kyat (MMK)</option>
<option value="BIF">Burundi, Franc (BIF)</option>
<option value="KHR">Cambodia, Riel (KHR)</option>
<option value="XAF">Cameroon, CFA Franc BEAC (XAF)</option>
<option value="CAD">Canada, Dollar (CAD)</option>
<option value="EUR">Canary Islands, Euro (EUR)</option>
<option value="CVE">Cape Verde, Escudo (CVE)</option>
<option value="KYD">Cayman Islands, Dollar (KYD)</option>
<option value="XAF">Central African Republic, CFA Franc BEAC (XAF)</option>
<option value="XAF">CFA Communauté Financière Africaine BEAC Franc (XAF)</option>
<option value="XOF">CFA Communauté Financière Africaine BCEAO Franc (XOF)</option>
<option value="XAF">Chad, CFA Franc BEAC (XAF)</option>
<option value="CLP">Chile, Peso (CLP)</option>
<option value="CNY">China, Yuan Renminbi (CNY)</option>
<option value="AUD">Christmas Island, Australia Dollar (AUD)</option>
<option value="AUD">Cocos (Keeling Islands, Australia Dollar (AUD)</option>
<option value="COP">Colombia, Peso (COP)</option>
<option value="XAF">Communauté Financière Africaine BEAC Franc (XAF)</option>
<option value="XOF">Communauté Financière Africaine BCEAO Franc (XOF)</option>
<option value="KMF">Comoros, Franc (KMF)</option>
<option value="XPF">Comptoirs Français du Pacifique Franc (XPF)</option>
<option value="XAF">Congo/Brazzaville, CFA Franc BEAC (XAF)</option>
<option value="CDF">Congo/Kinshasa, Franc (CDF)</option>
<option value="NZD">Cook Islands, New Zealand Dollar (NZD)</option>
<option value="AUD">Coral Sea Islands, Australia Dollar (AUD)</option>
<option value="CRC">Costa Rica, Colon (CRC)</option>
<option value="XOF">Côte d'Ivoire, CFA Franc BCEAO (XOF)</option>
<option value="HRK">Croatia, Kuna (HRK)</option>
<option value="CUC">Cuba, Convertible Peso (CUC)</option>
<option value="CUP">Cuba, Peso (CUP)</option>
<option value="ANG">Curaço, Netherlands Antilles Guilder (ANG)</option>
<option value="EUR">Cyprus, Euro (EUR)</option>
<option value="CZK">Czech Republic, Koruna (CZK)</option>
<option value="DKK">Denmark, Krone (DKK)</option>
<option value="DJF">Djibouti, Franc (DJF)</option>
<option value="XCD">Dominica, East Caribbean Dollar (XCD)</option>
<option value="DOP">Dominican Republic, Peso (DOP)</option>
<option value="EUR">Dutch (Netherlands), Euro (EUR)</option>
<option value="XCD">East Caribbean Dollar (XCD)</option>
<option value="USD">East Timor, United States Dollar (USD)</option>
<option value="USD">Ecuador, United States Dollar (USD)</option>
<option value="EGP">Egypt, Pound (EGP)</option>
<option value="SVC">El Salvador, Colon (SVC)</option>
<option value="USD">El Salvador, United States Dollar (USD)</option>
<option value="GBP">England (United Kingdom), Pound (GBP)</option>
<option value="XAF">Equatorial Guinea, CFA Franc BEAC (XAF)</option>
<option value="ERN">Eritrea, Nakfa (ERN)</option>
<option value="EEK">Estonia, Kroon (EEK)</option>
<option value="ETB">Ethiopia, Birr (ETB)</option>
<option value="EUR">Euro (EUR)</option>
<option value="EUR">Europa Island, Euro (EUR)</option>
<option value="FKP">Falkland Islands, Pound (FKP)</option>
<option value="DKK">Faroe Islands, Denmark Krone (DKK)</option>
<option value="FJD">Fiji, Dollar (FJD)</option>
<option value="EUR">Finland, Euro (EUR)</option>
<option value="EUR">France, Euro (EUR)</option>
<option value="EUR">French Guiana, Euro (EUR)</option>
<option value="XPF">French Polynesia, Comptoirs Français du Pacifique Franc (XPF)</option>
<option value="EUR">French Southern and Antarctic Lands, Euro (EUR)</option>
<option value="XAF">Gabon, CFA Franc BEAC (XAF)</option>
<option value="GMD">Gambia, Dalasi (GMD)</option>
<option value="ILS">Gaza Strip, Israel New Shekel (ILS)</option>
<option value="GEL">Georgia, Lari (GEL)</option>
<option value="EUR">Germany, Euro (EUR)</option>
<option value="GHS">Ghana, Cedi (GHS)</option>
<option value="GIP">Gibraltar, Pound (GIP)</option>
<option value="XAU">Gold Ounce (XAU)</option>
<option value="GBP">Great Britain (United Kingdom), Pound (GBP)</option>
<option value="EUR">Greece, Euro (EUR)</option>
<option value="DKK">Greenland, Denmark Krone (DKK)</option>
<option value="XCD">Grenada, East Caribbean Dollar (XCD)</option>
<option value="EUR">Guadeloupe, Euro (EUR)</option>
<option value="USD">Guam, United States Dollar (USD)</option>
<option value="GTQ">Guatemala, Quetzal (GTQ)</option>
<option value="GGP">Guernsey, Pound (GGP)</option>
<option value="GNF">Guinea, Franc (GNF)</option>
<option value="XOF">Guinea-Bissau, CFA Franc BCEAO (XOF)</option>
<option value="GYD">Guyana, Dollar (GYD)</option>
<option value="HTG">Haiti, Gourde (HTG)</option>
<option value="EUR">Holland (Netherlands), Euro (EUR)</option>
<option value="EUR">Holy See (Vatican City), Euro (EUR)</option>
<option value="HNL">Honduras, Lempira (HNL)</option>
<option value="HKD">Hong Kong, Dollar (HKD)</option>
<option value="HUF">Hungary, Forint (HUF)</option>
<option value="ISK">Iceland, Krona (ISK)</option>
<option value="INR">India, Rupee (INR)</option>
<option value="IDR">Indonesia, Rupiah (IDR)</option>
<option value="XDR">International Monetary Fund Special Drawing Right (XDR)</option>
<option value="IRR">Iran, Rial (IRR)</option>
<option value="IQD">Iraq, Dinar (IQD)</option>
<option value="EUR">Ireland, Euro (EUR)</option>
<option value="FKP">Islas Malvinas (Falkland Islands), Pound (FKP)</option>
<option value="IMP">Isle of Man, Pound (IMP)</option>
<option value="ILS">Israel, New Shekel (ILS)</option>
<option value="EUR">Italy, Euro (EUR)</option>
<option value="XOF">Ivory Coast (Côte d'Ivoire), CFA Franc BCEAO (XOF)</option>
<option value="JMD">Jamaica, Dollar (JMD)</option>
<option value="JPY">Japan, Yen (JPY)</option>
<option value="JEP">Jersey, Pound (JEP)</option>
<option value="USD">Johnson, United States Dollar (USD)</option>
<option value="JOD">Jordan, Dinar (JOD)</option>
<option value="EUR">Juan de Nova, Euro (EUR)</option>
<option value="KZT">Kazakhstan, Tenge (KZT)</option>
<option value="KES">Kenya, Shilling (KES)</option>
<option value="AUD">Kiribati, Australia Dollar (AUD)</option>
<option value="KWD">Kuwait, Dinar (KWD)</option>
<option value="KGS">Kyrgyzstan, Som (KGS)</option>
<option value="LAK">Laos, Kip (LAK)</option>
<option value="LVL">Latvia, Lat (LVL)</option>
<option value="LBP">Lebanon, Pound (LBP)</option>
<option value="LSL">Lesotho, Loti (LSL)</option>
<option value="LRD">Liberia, Dollar (LRD)</option>
<option value="LYD">Libya, Dinar (LYD)</option>
<option value="CHF">Liechtenstein, Switzerland Franc (CHF)</option>
<option value="LTL">Lithuania, Litas (LTL)</option>
<option value="EUR">Luxembourg, Euro (EUR)</option>
<option value="MOP">Macau, Pataca (MOP)</option>
<option value="MKD">Macedonia, Denar (MKD)</option>
<option value="MGA">Madagascar, Ariary (MGA)</option>
<option value="EUR">Madeira Islands, Euro (EUR)</option>
<option value="MWK">Malawi, Kwacha (MWK)</option>
<option value="MYR">Malaysia, Ringgit (MYR)</option>
<option value="MVR">Maldives, Rufiyaa (MVR)</option>
<option value="XOF">Mali, CFA Franc BCEAO (XOF)</option>
<option value="EUR">Malta, Euro (EUR)</option>
<option value="FKP">Malvinas (Falkland Islands), Pound (FKP)</option>
<option value="USD">Marshall Islands, United States Dollar (USD)</option>
<option value="EUR">Martinique, Euro (EUR)</option>
<option value="MRO">Mauritania, Ouguiya (MRO)</option>
<option value="MUR">Mauritius, Rupee (MUR)</option>
<option value="EUR">Mayotte, Euro (EUR)</option>
<option value="MXN">Mexico, Peso (MXN)</option>
<option value="USD">Micronesia, United States Dollar (USD)</option>
<option value="USD">Midway Islands, United States Dollar (USD)</option>
<option value="MDL">Moldova, Leu (MDL)</option>
<option value="EUR">Monaco, Euro (EUR)</option>
<option value="MNT">Mongolia, Tughrik (MNT)</option>
<option value="EUR">Montenegro, Euro (EUR)</option>
<option value="XCD">Montserrat, East Caribbean Dollar (XCD)</option>
<option value="MAD">Morocco, Dirham (MAD)</option>
<option value="MZN">Mozambique, Metical (MZN)</option>
<option value="MMK">Myanmar (Burma), Kyat (MMK)</option>
<option value="NAD">Namibia, Dollar (NAD)</option>
<option value="AUD">Nauru, Australia Dollar (AUD)</option>
<option value="HTG">Navassa, Haiti Gourde (HTG)</option>
<option value="USD">Navassa, United States Dollar (USD)</option>
<option value="NPR">Nepal, Rupee (NPR)</option>
<option value="ANG">Netherlands Antilles, Guilder (ANG)</option>
<option value="EUR">Netherlands, Euro (EUR)</option>
<option value="XPF">New Caledonia, Comptoirs Français du Pacifique Franc (XPF)</option>
<option value="NZD">New Zealand, Dollar (NZD)</option>
<option value="NIO">Nicaragua, Cordoba (NIO)</option>
<option value="XOF">Niger, CFA Franc BCEAO (XOF)</option>
<option value="NGN">Nigeria, Naira (NGN)</option>
<option value="NZD">Niue, New Zealand Dollar (NZD)</option>
<option value="AUD">Norfolk Island, Australia Dollar (AUD)</option>
<option value="KPW">North Korea, Won (KPW)</option>
<option value="USD">Northern Mariana Islands, United States Dollar (USD)</option>
<option value="NOK">Norway, Krone (NOK)</option>
<option value="OMR">Oman, Rial (OMR)</option>
<option value="PKR">Pakistan, Rupee (PKR)</option>
<option value="USD">Palau, United States Dollar (USD)</option>
<option value="XPD">Palladium Ounce (XPD)</option>
<option value="PAB">Panama, Balboa (PAB)</option>
<option value="USD">Panama, United States Dollar (USD)</option>
<option value="PGK">Papua New Guinea, Kina (PGK)</option>
<option value="CNY">Paracel Islands, China Yuan Renminbi (CNY)</option>
<option value="VND">Paracel Islands, Vietnam Dong (VND)</option>
<option value="PYG">Paraguay, Guarani (PYG)</option>
<option value="PEN">Peru, Nuevo Sol (PEN)</option>
<option value="PHP">Philippines, Peso (PHP)</option>
<option value="NZD">Pitcairn, New Zealand Dollar (NZD)</option>
<option value="XPT">Platinum Ounce (XPT)</option>
<option value="PLN">Poland, Zloty (PLN)</option>
<option value="EUR">Portugal, Euro (EUR)</option>
<option value="USD">Puerto Rico, United States Dollar (USD)</option>
<option value="QAR">Qatar, Riyal (QAR)</option>
<option value="EUR">Réunion, Euro (EUR)</option>
<option value="RON">Romania, New Leu (RON)</option>
<option value="RUB">Russia, Ruble (RUB)</option>
<option value="RWF">Rwanda, Franc (RWF)</option>
<option value="ANG">Saba, Netherlands Antilles Guilder (ANG)</option>
<option value="SHP">Saint Helena, Pound (SHP)</option>
<option value="XCD">Saint Kitts and Nevis, East Caribbean Dollar (XCD)</option>
<option value="XCD">Saint Lucia, East Caribbean Dollar (XCD)</option>
<option value="EUR">Saint Pierre and Miquelon, Euro (EUR)</option>
<option value="XCD">Saint Vincent and The Grenadines, East Caribbean Dollar (XCD)</option>
<option value="EUR">Saint-Martin, Euro (EUR)</option>
<option value="WST">Samoa, Tala (WST)</option>
<option value="EUR">San Marino, Euro (EUR)</option>
<option value="STD">São Tome and Principe, Dobra (STD)</option>
<option value="SAR">Saudi Arabia, Riyal (SAR)</option>
<option value="GBP">Scotland (United Kingdom), Pound (GBP)</option>
<option value="SPL">Seborga, Luigino (SPL)</option>
<option value="XOF">Senegal, CFA Franc BCEAO (XOF)</option>
<option value="RSD">Serbia, Dinar (RSD)</option>
<option value="SCR">Seychelles, Rupee (SCR)</option>
<option value="SLL">Sierra Leone, Leone (SLL)</option>
<option value="XAG">Silver Ounce (XAG)</option>
<option value="SGD">Singapore, Dollar (SGD)</option>
<option value="ANG">Sint Eustatius, Netherlands Antilles Guilder (ANG)</option>
<option value="ANG">Sint Maarten, Netherlands Antilles Guilder (ANG)</option>
<option value="EUR">Slovakia, Euro (EUR)</option>
<option value="EUR">Slovenia, Euro (EUR)</option>
<option value="SBD">Solomon Islands, Dollar (SBD)</option>
<option value="SOS">Somalia, Shilling (SOS)</option>
<option value="ZAR">South Africa, Rand (ZAR)</option>
<option value="GBP">South Georgia, United Kingdom Pound (GBP)</option>
<option value="KRW">South Korea, Won (KRW)</option>
<option value="GBP">South Sandwich Islands, United Kingdom Pound (GBP)</option>
<option value="EUR">Spain, Euro (EUR)</option>
<option value="LKR">Sri Lanka, Rupee (LKR)</option>
<option value="SDG">Sudan, Pound (SDG)</option>
<option value="SRD">Suriname, Dollar (SRD)</option>
<option value="NOK">Svalbard and Jan Mayen, Norway Krone (NOK)</option>
<option value="SZL">Swaziland, Lilangeni (SZL)</option>
<option value="ZAR">Swaziland, South Africa Rand (ZAR)</option>
<option value="SEK">Sweden, Krona (SEK)</option>
<option value="CHF">Switzerland, Franc (CHF)</option>
<option value="SYP">Syria, Pound (SYP)</option>
<option value="TWD">Taiwan, New Dollar (TWD)</option>
<option value="TJS">Tajikistan, Somoni (TJS)</option>
<option value="RUB">Tajikistan, Russia Ruble (RUB)</option>
<option value="TZS">Tanzania, Shilling (TZS)</option>
<option value="THB">Thailand, Baht (THB)</option>
<option value="XOF">Togo, CFA Franc BCEAO (XOF)</option>
<option value="NZD">Tokelau, New Zealand Dollar (NZD)</option>
<option value="TOP">Tonga, Pa'anga (TOP)</option>
<option value="MDL">Transnistria, Moldova Leu (MDL)</option>
<option value="TTD">Trinidad and Tobago, Dollar (TTD)</option>
<option value="TND">Tunisia, Dinar (TND)</option>
<option value="TRY">Turkey, Lira (TRY)</option>
<option value="TMT">Turkmenistan, New Manat (TMT)</option>
<option value="TMM">Turkmenistan, Manat (TMM)</option>
<option value="USD">Turks and Caicos Islands, United States Dollar (USD)</option>
<option value="AUD">Tuvalu, Australia Dollar (AUD)</option>
<option value="TVD">Tuvalu, Dollar (TVD)</option>
<option value="UGX">Uganda, Shilling (UGX)</option>
<option value="UAH">Ukraine, Hryvna (UAH)</option>
<option value="AED">United Arab Emirates, Dirham (AED)</option>
<option value="GBP">United Kingdom, Pound (GBP)</option>
<option value="USD">United States, Dollar (USD)</option>
<option value="UYU">Uruguay, Peso (UYU)</option>
<option value="UZS">Uzbekistan, Som (UZS)</option>
<option value="VUV">Vanuatu, Vatu (VUV)</option>
<option value="EUR">Vatican City, Euro (EUR)</option>
<option value="VEF">Venezuela, Bolivar Fuerte (VEF)</option>
<option value="VND">Vietnam, Dong (VND)</option>
<option value="USD">Virgin Islands, United States Dollar (USD)</option>
<option value="USD">Wake Island, United States Dollar (USD)</option>
<option value="XPF">Wallis and Futuna Islands, Comptoirs Français du Pacifique Franc (XPF)</option>
<option value="ILS">West Bank, Israel New Shekel (ILS)</option>
<option value="JOD">West Bank, Jordan Dinar (JOD)</option>
<option value="MAD">Western Sahara, Morocco Dirham (MAD)</option>
<option value="WST">Samoa, Tala (WST)</option>
<option value="YER">Yemen, Rial (YER)</option>
<option value="ZMK">Zambia, Kwacha (ZMK)</option>
<option value="ZWD">Zimbabwe, Dollar (ZWD)</option>
</select>
</td>
</tr>
<tr>
<td>
<input type="submit" value="Convert" />
</td>
</tr>
</table>
</form>


<?php


$action=$_REQUEST['act'];
$amount=$_REQUEST['amt'];
$countryFrom=$_REQUEST['From'];
$countryTo=$_REQUEST['to'];



if(isset($action)){
if($amount>0 && is_numeric($amount)){
//echo 'in amount';
?>

<table align="center" width="500px" style="border:#CCCCCC solid 1px;">
<tr>
<td><strong>Converted Amount :-</strong><br /></td></tr>
<tr>
<td bgcolor="#E9E9E9">
<strong><script type="text/javascript">getExchangeRates('<?=$amount?>','<?=$countryFrom?>','<?=$countryTo?>','true') </script></strong> <?=$countryTo?>
</tr>
</table>
<?php }else{
echo 'Enter Amount More Then 0';
}
}

Wednesday, October 27, 2010

How can i remove notice from my php pages

You could  turn off notices in the error reporting if you have access to php.ini:

Quote:
 
      ; - Show all errors, except for notices
       error_reporting = E_ALL & ~E_NOTICE 

PHP Frameworks !! Why , when and which ?

  Today, I’m going to talk about PHP frameworks. Please note that the choice of choosing a framework is personal preference and the statement and this post is not going to say that this framework is better than this framework.

Sending e-mail from localhost in PHP in Windows Environment

Have you ever been frustrating, why e-mail is not going from the localhost while using XAMPP or WAMP or any other PHP servers in windows environment? well in that situation i think i can help you.In this article i am going to tell you how to send e-mail from localhost in PHP.



1) Open the “php.ini“. You should know where it is located because it depends upon the particular server you’re running.

2) Search for the attribute called “SMTP” in the php.ini file.Generally you can find the line “SMTP=localhost“. change the localhost to the smtp server name of your ISP. And, there is another attribute called “smtp_port” which should be set to 25.I’ve set the following values in my php.ini file.

SMTP = smtp.wlink.com.np
smtp_port = 25
3) Restart the apache server so that PHP modules and attributes will be reloaded.

4) Now try to send the mail using the mail() function ,


mail(“you@yourdomain.com”,”test subject”,”test body”);
you might get the warning like this,
 
Warning: mail() [function.mail]: “sendmail_from” not set in php.ini or custom “From:” header missing in C:\Program Files\xampp\htdocs\testmail.php on line 1

5) Now specify the following headers and try to send the mail again,
$headers = ‘MIME-Version: 1.0′ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1′ . “\r\n”;
$headers .= ‘From: sender@sender.com’ . “\r\n”;
mail(“you@yourdomain.com”,”test subject”,”test body”,$headers);
Well that’s all, the mail is sent to “you@yourdomain.com” from the localhost.

Note : Some smtp server verifies the email address of the sender so the email address which is in the place of “sender@sender.com” should be a valid and existing email address otherwise mail might not be sent to the “you@yourdomain.com”.

Hide .php extension with url rewriting using .htaccess

what is the benefits of rewriting URL?

When a search engine visits the dynamic url like product.php?id=5 it does not give much importance to that URL as search engine sees “?” sign treat it as a url which keeps on changing. so we’re converting the dynamic URL like the product.php?id=5 to static url format like product-5.html. We’ll rewrite the url in such a way that in browser’s address bar it will display as a product-5.html but it actually calls the file product.php?id=5. So that why these kind of URL also named as SEO friendly URL.


what is required for URL rewriting ??

To rewrite the URL you must have the mod_rewrite module must be loaded in apache server. And furthermore, FollowSymLinks options also need to be enabled otherwise you may encounter 500 Internal Sever Error. If you don’t know much about mod_rewrite module then please check this post to know how to check and enable mod_rewrite module in apache?

Examples of url rewriting for seo friendly URL

 

For rewriting the URL, you should create a .htaccess file in the root folder of your web directory. And have to put the following codes as your requirement.
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [nc]


The following example will rewrite the test.php to test.html i.e when a URL like http://localhost/test.htm is called in address bar it calls the file test.php. As you can see the regular expression in first part of the RewriteRule command and $1 represents the first regular expression of the part of the RewriteRule and [nc] means not case sensitive.
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^product-([0-9]+)\.html$ products.php?id=$1


The following example will rewrite the product.php?id=5 to porduct-5.html i.e when a URL like http://localhost/product-5.html calls product.php?id=5 automatically

Getting real IP address in PHP

Are you using $_SERVER['REMOTE_ADDR'] to find the the client’s IP address in PHP? Well dude, you might be amazed to know that it may not return the true IP address of the client at all time. If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine. So here is a simple function in PHP to find the real IP address of the client’s machine. There are extra Server variable which might be available to determine the exact IP address of the client’s machine in PHP, they are HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR.

Function to find real IP address in PHP

function getRealIpAddr()
{
    if (!empty($_SERVER['HTTP_CLIENT_IP']))      {
      $ip=$_SERVER['HTTP_CLIENT_IP'];
    }
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))  {
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else
    {
      $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}
In this PHP function, first attempt is to get the direct IP address of client’s machine, if not available then try for forwarded for IP address using HTTP_X_FORWARDED_FOR. And if this is also not available, then finally get the IP address using REMOTE_ADDR.

Tuesday, October 26, 2010

Ajax-an example to start with...

<html>
<head>
<script type="text/javascript">
function loadXMLDoc()
{
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","ajax_info.txt",true);
xmlhttp.send();
}
</script>
</head>
<body>

<div id="myDiv"><h2>Let AJAX change this text</h2></div>
<button type="button" onclick="loadXMLDoc()">Change Content</button>

</body>
</html>

Monday, October 25, 2010

PHP FRAMEWORKS

Project↓ Current Stable Version↓ Release Date↓ License↓
CakePHP 1.3.4 2010-09-12 MIT
CodeIgniter 1.7.2 2009-09-11 BSD-style
Drupal 6.19 2010-08-11 GPL
Horde 3.3.9 2010-09-28 LGPL
Lithium 0.9.5 2010-04-28
Qcodo 0.4.16 2010-06-09 MIT
Seagull 0.6.7 2010-02-23 BSD
Symfony 1.4.8 2010-09-24 MIT
Yii 1.1.4 2010-09-05 BSD
Zend Framework 1.10.8 2010-08-25 BSD




PHP 5.3.3 Released!

The PHP development team would like to announce the immediate availability of PHP 5.3.3. This release focuses on improving the stability and security of the PHP 5.3.x branch with over 100 bug fixes, some of which are security related. All users are encouraged to upgrade to this release. Backwards incompatible change:Methods with the same name as the last element of a namespaced class name will no longer be treated as constructor. This change doesn't affect non-namespaced classes. ?php namespace Foo; class Bar {     public function Bar() {         // treated as constructor in PHP 5.3.0-5.3.2         // treated as regular method in PHP 5.3.3     } } ? There is no impact on migration from 5.2.x because namespaces were only introduced in PHP 5.3.Security Enhancements and Fixes in PHP 5.3.3:Rewrote var_export() to use smart_str rather than output buffering, prevents data disclosure if a fatal error occurs (CVE-2010-2531).Fixed a possible resource destruction issues in shm_put_var().Fixed a possible information leak because of interruption of XOR operator.Fixed a possible memory corruption because of unexpected call-time pass by refernce and following memory clobbering through callbacks.Fixed a possible memory corruption in ArrayObject::uasort().Fixed a possible memory corruption in parse_str().Fixed a possible memory corruption in pack().Fixed a possible memory corruption in substr_replace().Fixed a possible memory corruption in addcslashes().Fixed possible buffer overflows in mysqlnd_list_fields, mysqlnd_change_user.Fixed possible buffer overflows when handling error packets in mysqlnd.Key enhancements in PHP 5.3.3 include

SIMPLE PHP SCRIPT

<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo '<p>Hello World</p>'?>
 </body>
</html>