Show Avatar

Status
Not open for further replies.
Newbie Spellweaver
Joined
Sep 11, 2010
Messages
22
Reaction score
5
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:
0cean - Show Avatar - RaGEZONE Forums

SREENIE:
0cean - Show Avatar - RaGEZONE Forums
 
Last edited:
None gives a **** Putako, btw it's simple but good try I guess.
 
If I was you, I would change:

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

to:

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

...to prevent SQL injections.
 
Lol. This looks like a shitty code, It has restrictions. Also you can do injections.

---------- Post added at 10:09 PM ---------- Previous post was at 10:07 PM ----------

If your going to flame saying show you a better code?
 
Last edited:
Lol. This looks like a shitty code, It has restrictions. Also you can do injections.

---------- Post added at 10:09 PM ---------- Previous post was at 10:07 PM ----------

If your going to flame saying show you a better code?
Woah, stop hating. He tried.
 
Status
Not open for further replies.
Back