Guest User

Untitled

a guest
Jun 5th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?php
  2. error_reporting(E_ALL);
  3.  
  4. $dbhost = "216.245.219.172";
  5. $dbuser = "website";
  6. $dbpass = "xxxxxxxxxxxxxx";
  7. $dbname = "habplus_hotel";
  8.  
  9. $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
  10. mysql_select_db($dbname);
  11.  
  12. $query = 'SELECT COUNT(*) FROM `users` WHERE `online` > 1';
  13. $result = mysql_query($query) or die('Habplus = Offline ' . mysql_error());
  14. $numberofresults = mysql_result($result, 0);
  15.  
  16. $result = mysql_query("SELECT * FROM server_status");
  17.  
  18. $row = mysql_fetch_array( $result );
  19. $text = " ";
  20. $image = imagecreatefrompng('images/10.png');
  21. $black = imagecolorallocate($image, 0, 0, 0);
  22. imagefttext($image, 14, 0,190, 49, $black, './Ubuntu-B.ttf', $row['users_online']);
  23. // imagefttext($image, 10, 0, 182, 75, $black, './verdana.ttf', $text); // Remove the // ahead of this line to use it
  24. header('Content-type: image/png');
  25. imagepng($image);
  26. imagedestroy($image);
  27. ?>
Add Comment
Please, Sign In to add comment