Show Avatar

Status
Not open for further replies.

JayNZ

Member
Feb 22, 2011
78
7
This is a small and easy script that you can use in news forums anywhere :}


PHP:
<?php 
header("Content-Type: image/PNG"); 
?> 
<?php 

$dbhost = 'localhost'; 
$dbuser = 'root'; 
$dbpass = 'Password'; 
$db = 'Database'; 

mysql_connect($dbhost,$dbuser,$dbpass);   
mysql_select_db($db);   

$u = $_GET["user"]; 
$userq = mysql_query("SELECT * FROM users WHERE username = '$u' LIMIT 1"); 
        $user = mysql_fetch_array($userq); 


$image = ImageCreateFromPNG("stand.png"); 
$looks = $user['look']; 
$look =  

ImageCreateFromPNG("http://www.habbo.com/habbo-imaging/avatarimage?figure='.$looks.''&action=wav&direction=2&head_direction=3 

&gesture=sml&size=l&img_format=png"); 
    imagecopy($image, $look, 9, 10, 6, 13, 49, 94); 


ImagePng ($image); 
imagedestroy($image); 


?>
To use go to
file.php?user=User

Please dont flame its only a small and easy code.
Stand.png file:
SREENIE:
screenieu.png
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
Nice code, however, change:

PHP:
$u = $_GET["user"];

to:

PHP:
$u = mysql_real_escape_string( strip_tags( $_GET["user"] ) );

...to prevent SQL injections.
 

Mastah

the funny thing is \r\n i did
Oct 25, 2010
739
41
it's nice yes thanks for releasing and thanks to m0nsta for correcting it out
 
Status
Not open for further replies.

Users who are viewing this thread

Top