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";
imagepng($my_img, $directory, 0, NULL);
if (file_exists($directory)){
echo '<img src="'.$directory.'" />';
echo 'Cannot create picture on this server';

but nothing saved on server.

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 .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.