This code shows a random number inside a picture:
Header ("Content-type: image/png");
$img_handle = imageCreateFromPNG("Secure.png");
$color = ImageColorAllocate ($img_handle, 100, 100, 100);
$jo = "6767fjddms8";
$random_digit=rand(00000000000000,99999999999999);
ImageString ($img_handle, 12, 32, 7, "$random_digit", $color);
ImagePng ($img_handle);
ImageDestroy ($img_handle);
?>
This works fine. But i want this picture to be shown on a webpage as well as other things so i put that code into a .inc file. Then i included that file in another page on my site but it read the header from the inc file and said "ERROR - Headed already sent.
How do i stop this from happening?
So it just shows the picture along with ohter things on the page?
2006-12-03
02:49:46
·
4 answers
·
asked by
peter s
1
in
Computers & Internet
➔ Programming & Design