LawyerMorty

Untitled

May 1st, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. <?php
  2.  
  3. // if the image won't load proper, put a // before the header to show the error
  4. //header ("Content-type: image/png");
  5.  
  6. // Turn off error reporting, so the fucking script does not show notices
  7. error_reporting(0);
  8.  
  9. // Image create shit
  10. $imgname = "background.png";
  11. $im = @imagecreatefrompng ($imgname);
  12.  
  13. // Create some colors
  14. $white = imagecolorallocate($im, 255, 255, 255);
  15. $grey = imagecolorallocate($im, 128, 128, 128);
  16. $black = imagecolorallocate($im, 0, 0, 0);
  17.  
  18. // MySQL
  19. $acc = 'LilDollaTechZone';
  20. $base = mysql_connect ('127.0.0.1', '***', '***');
  21. mysql_select_db ('***', $base);
  22.  
  23. $sql = "SELECT name, balance FROM *** WHERE name = '$acc'";
  24. $req = mysql_query($sql);
  25. while($data = mysql_fetch_array($req)){
  26. $name = $data['name'];
  27. $cash = $data['balance'];
  28.  
  29. // You can use any .tff font
  30. $font = './font.ttf';
  31. $pname = 'Name: '.$name;
  32. $money = 'Money: $'.number_format($cash);
  33.  
  34. // The text here, there are 2 one is for shadow.
  35. // imagettftext(image, font size, angle, x, y, color, font, "text");
  36. imagettftext($im, 24, 0, 4, 30, $black, $font, "GTi Bank");
  37. imagettftext($im, 24, 0, 6, 31, $white, $font, "GTi Bank");
  38. // Name Test
  39. imagettftext($im, 18, 0, 115, 20, $black, $font, $pname);
  40. imagettftext($im, 18, 0, 117, 21, $white, $font, $pname);
  41. // Money Text
  42. imagettftext($im, 18, 0, 115, 45, $black, $font, $money);
  43. imagettftext($im, 18, 0, 117, 46, $white, $font, $money);
  44.  
  45. // Some stuff
  46. imagepng($im);
  47. imagedestroy($im);
  48. }
  49. mysql_close();
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment