Uhuh, this is what I've:
Code:
<?php
#Coded by Predator3598
#For Ragezone
function creerFichier($fichierChemin, $fichierNom, $fichierExtension, $fichierContenu, $droit=""){
$fichierCheminComplet = $_SERVER["DOCUMENT_ROOT"].$fichierChemin."/".$fichierNom;
if($fichierExtension!=""){
$fichierCheminComplet = $fichierCheminComplet.".".$fichierExtension;
}
// create file on server
$leFichier = fopen($fichierCheminComplet, "wb");
fwrite($leFichier,$fichierContenu);
fclose($leFichier);
// permission
if($droit==""){
$droit="0777";
}
// Checking if the file was created well
$t_infoCreation['fichierCreer'] = false;
if(file_exists($fichierCheminComplet)==true){
$t_infoCreation['fichierCreer'] = true;
}
// we apply the permission to the file created
$retour = chmod($fichierCheminComplet,intval($droit,8));
$t_infoCreation['permissionAppliquer'] = $retour;
return $t_infoCreation;
}
if(isset($_GET['look']))
{
$look = $_GET['look'];
if(file_exists($_SERVER["DOCUMENT_ROOT"]."/avatar/".$look.".gif"))
{
$imagesrv = "http://localhost/avatar/".$look.".gif";
$img = file_get_contents($imagesrv);
header("Content-type: image/png");
echo($img);
}
else
{
$image = "http://www.habbo.com/habbo-imaging/avatarimage?figure=".$look."&size=b&direction=3&head_direction=3&gesture=sml";
$dataimg = file_get_contents($image);
creerFichier("/avatar", $look, "gif", $dataimg, "0777");
$imagesrv = "http://localhost/avatar/".$look.".gif";
$img = file_get_contents($imagesrv);
header("Content-type: image/png");
echo($img);
}
}
else
{
echo("Error: The variables are not filled! ( ?look= )");
}
?>
And in my index, I edited it so as it looks like this (doesn't work)
Code:
<img src="http://localhost/avatar.php?look={figure}&action=wav&direction=2&head_direction=3&gesture=srp&size=l" id="user"/>
which originally worked with
Code:
<img src="http://http://www.habbo.com/habbo-imaging/avatarimage??figure={figure}&action=wav&direction=2&head_direction=3&gesture=srp&size=l" id="user"/>
so {figure} tag must be valid, the error therefore lies somewhere else. I'm new to PHP, but it makes more sense to me that the error is within the script. Help, anyone? Thanks in advance.