Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getConvertion($currency,$value){
- $conversionRates = array(
- '£'=>'1.0',
- '$'=>'1.59030',
- '€'=>'1.14276'
- );
- return $value * $conversionRate[$currency];
- }
- function splitRequestString($string){
- $currency = substr($string,0,1));
- $value = explode(' ',$string);
- $value = substr($value[1],0,1)
- return array($currency,$value);
- }
- $request = splitRequestString($_POST['request']);
- $deduct = getConvertion($request[1]);
- $update = mysql_query('UPDATE members SET points = (points - '.$deduct.') WHERE id = "'.$_POST['id'].'"')
- or die(mysql_error());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement