<?php
//error reporting is set to E_ALL
error_reporting(E_ALL);
$im = imagecreate(100, 100);
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);
//this function is depricated and should be replaced with
//the following two uncommented lines
//imagedashedline($im, 0, 0, 99, 99,$white);
$st = array($white,$white,$white,$white,$black,$black,$black,$black);
imagesetstyle($im,$st);
imageline($im,0,0,99,99,IMG_COLOR_STYLED);
//header is moved to the end of the script so that
//errors will be printed to the browser window
header ("Content-Type: image/png");
imagepng($im);
imagedestroy($im);
?>