neilmichael9797
New Member
- Messages
- 7
- Reaction score
- 0
- Points
- 1
Hi, I'm trying to use the imagepng function to create a simple dynamic signature.
Here is my code:
This all works fine, except, it does not output a png image, rather it is a php image (See pic)
As you can see, it is 12.php when it should be 12.png
Any help is appreciated!
Here is my code:
PHP:
<?php
$my_img = imagecreate( 200, 80 );
$background = imagecolorallocate( $my_img, 0, 0, 255 );
$text_colour = imagecolorallocate( $my_img, 255, 255, 0 );
$line_colour = imagecolorallocate( $my_img, 128, 255, 0 );
imagestring( $my_img, 4, 30, 25, "testing",
$text_colour );
imagesetthickness ( $my_img, 5 );
imageline( $my_img, 30, 45, 165, 45, $line_colour );
header( "Content-type: image/png" );
imagepng( $my_img );
imagecolordeallocate( $line_color );
imagecolordeallocate( $text_color );
imagecolordeallocate( $background );
imagedestroy( $my_img );
?>

As you can see, it is 12.php when it should be 12.png
Any help is appreciated!