PHP Banner with Online Count ( No Other File Needed )

LethalEdward

Member
Sep 2, 2010
119
22
Hello,

i have seen this been released but i thought i'd let my code out as it doesn't need an external file some people need as an online.cfm or online.php

PHP:
<?php

$dbhost = 'localhost';
$dbuser = 'Username';
$dbpass = 'Password';
$dbname = 'Database';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');
mysql_select_db($dbname);

$result = mysql_query("SELECT * FROM server_status");

$row = mysql_fetch_array( $result );
$text = "Habbos Online";
$image = imagecreatefrompng('images/02.png');
$black = imagecolorallocate($image, 0, 0, 0);
imagefttext($image, 8, 0, 182, 80, $black, './verdanab.ttf', $row['users_online']);
// imagefttext($image, 8, 0, 182, 75, $black, './verdana.ttf', $text); // Remove the // ahead of this line to use it
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
?>

Use this code or download it

Replace the image.

Credits All To Me
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
Yes i proved it cause the noob is spreading info i am using his code and telling if i coded mine it is not as good as his.

Thanks btw xD
then that kid has no sense does he?
hes a complete idiot who thinks he can code
I think hes just jealous
good job edward :)
 

Livar

Now 35% cooler!
Oct 15, 2010
846
86
Yeah, but instead of using the database connection on one file, just connect it to Uber's main global, there's absolutely no need to do that. /sigh.
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
owell
Its good coding
and I had it before all of you >;]
that makes me special
obv Edward had it before me but
It still makes me special >;]
 

Meap

Don't need glasses if you C#
Nov 7, 2010
1,045
296
hmm
Ill upload mine quickly, brb
MINES FUCNTIONAL SO HERE YOU GO

as I think edward only posted the index.php code
you need the vernab.ttf file or w.e and the image :)
 

LethalEdward

Member
Sep 2, 2010
119
22
I did post everything in the download link if you do not understand the code. and if you have windows u do not need verdanab.tff and the other font is just incase they wanted to change.
 

Jo$h

Posting Freak
Jul 7, 2010
1,030
79
Great Job mate! Really Sexy and works great as you can see on TheHabbos at least half of the retroes anymore are using this code.
 

HrCrazy

New Member
Jun 4, 2011
19
0
I might sound like a noob, but is there any chance of the banner working with this code?

<?php
$onc = file_get_contents("http:/habbo.bz/online.php");
echo $onc;
?>
 

Users who are viewing this thread

Top