Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username = $_GET['username'];
- // Create the image
- $im = imagecreatefrompng("images/image.PNG");
- // Create some colors
- $white = imagecolorallocate($im, 255, 255, 255);
- $grey = imagecolorallocate($im, 128, 128, 128);
- $black = imagecolorallocate($im, 0, 0, 0);
- //SQL connection stuff
- include "connect.php";
- $sql = "SELECT * FROM hfslayer WHERE username='".$username."'";
- $res = mysql_query($sql)or die(mysql_error());
- $row = mysql_fetch_array($res);
- $totaltime = doubleVal($row['time']);
- $totalxp = doubleVal($row['xp']);
- $totalprofit = doubleVal($row['profit']);
- $totaltask = doubleVal($row['task']);
- // The text to draw
- $s1 = "Hours ran: ";
- $ts1 = $s1 . $totaltime;
- $s2 = "XP gained: ";
- $ts2 = $s2 . $totalxp . "K";
- $s3 = "Profit: ";
- $ts3 = $s3 . $totalprofit . "K";
- $s4 = "Tasks done: ";
- $ts4 = $s4 . $totaltask;
- //ImageFill($im, 0, 0, $grey);
- imagestring($im, 60, 10, 60, $ts1, $white);
- imagestring($im, 75, 10, 75, $ts2, $white);
- imagestring($im, 90, 10, 90, $ts3, $white);
- imagestring($im, 105, 10, 105, $ts4, $white);
- // Set the content-type
- header("Content-type: image/png");
- // Using imagepng() results in clearer text compared with imagejpeg()
- imagepng($im);
- imagedestroy($im);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement