Code: Select all
<?php
session_start();
//You no getting da' database bro!
$id = $_GET['id'];
$main = "resources/charN.png";
$pants = "resources/AlienPants.png";
$shirt = "transparant.png";
$hair = "transparant.png";
$weapon = "transparant.png";
$face = "transparant.png";
$profileInfo = mysql_query("SELECT * FROM users WHERE userID=$id");
while ($row6=mysql_fetch_assoc($profileInfo)){
$displayItems = mysql_query("SELECT * FROM items WHERE itemID='".$row6['userShirt']."'");
while ($row22=mysql_fetch_assoc($displayItems)){
$shirt = "resources/".$row22['itemImg'];
}
$displayItems = mysql_query("SELECT * FROM items WHERE itemID='".$row6['hair']."'");
while ($row22=mysql_fetch_assoc($displayItems)){
$hair = "resources/".$row22['itemImg'];
}
$displayItems = mysql_query("SELECT * FROM items WHERE itemID='".$row6['userShoes']."'");
while ($row22=mysql_fetch_assoc($displayItems)){
$shoes = "resources/".$row22['itemImg'];
}
$displayItems = mysql_query("SELECT * FROM items WHERE itemID='".$row6['userPants']."'");
while ($row22=mysql_fetch_assoc($displayItems)){
$pants = "resources/".$row22['itemImg'];
}
$displayItems = mysql_query("SELECT * FROM items WHERE itemID='".$row6['userWeapon']."'");
while ($row22=mysql_fetch_assoc($displayItems)){
$weapon = "resources/".$row22['itemImg'];
}
$displayItems = mysql_query("SELECT * FROM items WHERE itemID='".$row6['userFace']."'");
while ($row22=mysql_fetch_assoc($displayItems)){
$face = "resources/".$row22['itemImg'];
}
}
/*echo $pants;
echo $shirt;
echo $weapon;
echo $face;
echo $shoes;
echo $main;*/
$main = imagecreatefrompng($main);
$pants = imagecreatefrompng($pants);
$shirt = imagecreatefrompng($shirt);
imagealphablending($main, true);
imagesavealpha($main, true);
imagecopymerge($main, $pants, 0, 0, 0, 0, 200, 200, 100); //have to play with these numbers for it to work for you, etc.
header('Content-Type: image/png');
imagepng($main);
imagedestroy($main);
imagedestroy($pants);
imagedestroy($shirt);
?>