It does save speed, though, but in light, it doesn't seem efficient if the person has changed their avatar. Caching is worth it.
Printable View
It might take up space, but i have a fairly small hotel, so not that much avatar's are cached in the long run.
PHP Code:foreach ($_GET as $key => $value)
{
$_GET[$key] = mysql_real_escape_string($value);
}
Haha, nice script. Thankz nigga!
Maybe it does not effect the performance but as the only thing he really gets from the database is the look. Wouldent it then be better with a mysql_result?
Like this:
PHP Code:$look = mysql_result(mysql_query("SELECT look FROM users WHERE username = '" . $u . "'"), 0);
Good job guy, but this script does not support the use HTML tags <img>, try the php document be interpreted as an image like mine: http://www.maniahotel.com.br/avatar?...ure=sml&size=b
Good job guy, but this script does not support the use HTML tags <img>, try the php document be interpreted as an image like mine:
http://www.maniahotel.com.br/avatar?...ure=sml&size=b
If it matter, yes, i did.
Something like this?:
PHP Code:<?php
header("Content-Type: image/png");
?>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$db = 'uber';
mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db($db);
$action = mysql_real_escape_string( strip_tags( $_GET["action"] ) );
$direction = mysql_real_escape_string( strip_tags( $_GET["direction"] ) );
$head_direction = mysql_real_escape_string( strip_tags( $_GET["head_direction"] ) );
$gesture = mysql_real_escape_string( strip_tags( $_GET["gesture"] ) );
$size = mysql_real_escape_string( strip_tags( $_GET["size"] ) );
$u = mysql_real_escape_string( strip_tags( $_GET["user"] ) );
$userq = mysql_query("SELECT * FROM users WHERE username = '$u' LIMIT 1");
$user = mysql_fetch_array($userq);
$looks = $user['look'];
$image = imagecreatefrompng("stand.png");
$look = imagecreatefrompng("http://habbo.com/habbo-imaging/avatarimage?figure='.$looks.'&action=" . $action . "&direction=" . $direction . "&head_direction=" . $h_direction . "&gesture=" . $gesture . "&size=" . $size . "");
imagecopy($image, $look, 9, 10, 6, 13, 49, 94);
ImagePng ($look);
imagedestroy($look);
// $result = mysql_query($query) or die('Query failed: ' . mysql_error()); //Okay
// if(mysql_num_rows($result)) { //thihi<3
// while($row = mysql_fetch_assoc($result)) { //resultat...
// echo "<img src=\"http://habbo.com/habbo-imaging/avatarimage?figure=".$row['look']."\" alt='".$row['username']."'>";
// }
// }
?>