PHP Classes

File: converter.php

Recommend this page to a friend!
  Classes of Anish Karim C   Realtime PHP Currency Exchange   converter.php   Download  
File: converter.php
Role: Example script
Content type: text/plain
Description: Example File
Class: Realtime PHP Currency Exchange
Convert currency amounts using different sites
Author: By
Last change: Adding Keys in README for testing purpose.
Date: 10 years ago
Size: 775 bytes
 

Contents

Class file image Download
<?php
/**
 * @package currency converter
 * Intermediate Script
 * @uses currencyConverter.class
 */
error_reporting(E_ALL);
include_once(
'currencyConverter.class.php');

$converterObj = new currencyConverter();
//$converterObj->ErrorLog = FALSE; //To Turn off the Exception Logging [Not Recommended].
//$converterObj->OpenExchangeAppId = ''; //Open Exchange App ID. Please see README for details.
$converterObj->CurrencyApiKey = '1cd79c61dd1b6b50f7eb2026e397e75e49c82221'; //Currency API Key. Please see README for more details.

$converterObj->FromCurrency = $_POST['from'];
$converterObj->ToCurrency = $_POST['to'];
$amount = $_POST['amt'];
//$amount = 5;

echo $amount." ".$_POST['from']. " is ".$converterObj->convert($amount)." ".$_POST['to'];
exit;