Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  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());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement