<?php
if(isset($_GET['baseC'])) {
	$newcurrency =  mysqli_escape_string($conn, $_GET['baseC']);
	
/* READ VALUES AND MAKE CALCULATIONS */
@$base    = 'USD';
@$foreign = $newcurrency;
@$amount  = '1';

/* require class and create function */
require ('class.php');
function format($amount) { return round($amount); }

/* create object */
$fx = new exchange($base, $foreign);

/* echo the value */
$finaltotal = $fx->toForeign($amount);
	
} else {
	$newcurrency = 'USD';
	$finaltotal = '1';
}

if($newcurrency == 'USD') {
		$currencysymbol = '$';	
	} else {
		$currencysymbol = $newcurrency;
	}
?>