daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getConvertion($currency,$value){
  2.     $conversionRates = array(
  3.         '£'=>'1.0',
  4.         '$'=>'1.59030',
  5.         '€'=>'1.14276'
  6.     );
  7.     return $value * $conversionRate[$currency];
  8. }
  9. function splitRequestString($string){
  10.     $currency = substr($string,0,1));
  11.     $value = explode(' ',$string);
  12.     $value = substr($value[1],0,1)
  13.    
  14.     return array($currency,$value);
  15. }
  16.  
  17. $request = splitRequestString($_POST['request']);
  18. $deduct = getConvertion($request[1]);
  19.  
  20. $update = mysql_query('UPDATE members SET points = (points - '.$deduct.') WHERE id = "'.$_POST['id'].'"')
  21. or die(mysql_error());
RAW Paste Data
Top