The following code causes a non-descript error in today’s php. Any help in pointing out where updates are needed would be appreciated.
<?php
error_reporting(E_ALL);
$image = ImageCreate(320, 200);
$color = ImageColorAllocate($image, 254, 254, 254);
ImageFill($image, $color);
for($iLoop = 0; $iLoop < 1000; $iLoop++)
{
$color = ImageColorAllocate($image, rand() % 256, rand() % 256, rand() % 256);
ImageSetPixel($image, rand() % 320, rand() % 200, $color);
}
header("Contet-type: image/png");
ImagePng($image);
ImageDestroy($image);
?>
I am trying to make the code from a 2002 book in PHP game programming working today
1