0

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.

1
Contributor
1
Reply
9
Views
1 Year
Discussion Span
Last Post by OsaMasw
1

am sorry for this disturbing but I solve my problem
its was silly of me not noticing the extension for file, its was written as PNG not png so linux server is case sensitive for these thing :P
have a nice day .

Edited by OsaMasw

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.