hey guys
I hope you doing well :P
am working on simple graphic script which gather some information and write it on image then show it to the user
on localhost the project run perfectly as it supposed to do.
when I uploaded to live server ( free hosting servers ) its seems it cannot create image on server, I've tried many methods for saving images but no luck, here is is my peace of code
$my_img = imagecreatefrompng ("background.PNG");
$my_avt = imagecreatefrompng($avatar);
imagestring( $my_img, 5, 70, 35, "Username", $text_black );
//doing some stuff to get width, height
imagecopy($my_img, $my_avt, imagesx($my_img) - $sx - $marge_right, imagesy($my_img) - $sy - $marge_bottom, 0, 0, imagesx($my_avt), imagesy($my_avt));
$filename = "username";
$directory = $filename.".png";
chmod($directory,0755);
imagepng($my_img, $directory, 0, NULL);
imagedestroy($my_img);
if (file_exists($directory)){
echo '<img src="'.$directory.'" />';
}else{
echo 'Cannot create picture on this server';
}
but nothing saved on server.