Advertisement
Guest User

Online Script

a guest
Jun 7th, 2016
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. <?php
  2.  
  3. $dbhost = '127.0.0.1';
  4. $dbuser = 'root';
  5. $dbpass = '';
  6. $dbname = 'premieredb';
  7.  
  8. $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to MySQL database, check details!');
  9. mysql_select_db($dbname);
  10.  
  11. $result = mysql_query("SELECT count(*) FROM users WHERE online = '1'");
  12.  
  13. $online = "Users Online!";
  14.  
  15. $row = mysql_fetch_array( $result );
  16. $image = imagecreatefrompng('images/banner.png');
  17. $font_color = imagecolorallocate($image, 255, 0, 0);
  18. imagefttext($image, 20, 0, 417, 30, $font_color, './arial.ttf', $row;
  19. imagefttext($image, 8, 0, 398, 45, $font_color, './arial.ttf', $online);
  20. imagefttext($image, 20, 0, 394, 77, $font_color, './arial.ttf', $num_rows);
  21. header('Content-type: image/png');
  22. imagepng($image);
  23. imagedestroy($image);
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement