Hi I coded an image generator from textbox to image, after it creates, when I want to save it as image it shows me -*.php file, and not .png (image)- code:
$name = $_POST['tekst'];
$file ="imgs/tbybc1.png";
header('Content-Type: image/png');
$im = imagecreatefrompng($file);
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
$text = $name;
$font = 'fonts/Roboto-Thin.ttf';
imagettftext($im, 40, 0, 70, 215, $white, $font, $text);
//imagettftext($im, 20, 0, 260, 255, $white, $font, $data);
imagepng($im);
imagedestroy($im);
what can I do for it, i googled but I didn't find anything. is there any solution to do this? or if there is any method of image generator tell me :) Thank You :)