Hi,
I have a code that exceeds the maximum execution time of 60 seconds. I suspect it may be an infinite loop created by accident.
I'm trying to create an online image grid generator, but need some help. You can find it at:
http://www.johninteractive.net/dynamic-images/grid.html
Here is the code:
<?php
$image = imagecreate($_GET['width'], $_GET['height']);
$color = imagecolorallocate($image, $_GET['color1'], $_GET['color2'], $_GET['color3']);
$color2 = imagecolorallocate($image, $_GET['color4'], $_GET['color5'], $_GET['color6']);
$widthspacing = $_GET['widthspacing'];
for ($i = 0; $i <= $width; $i += $widthspacing) {
imageline($image, $i, 0, $i, 255, $color2);
}
$heightspacing = $_GET['heightspacing'];
for ($i = 0; $i <= $height; $i += $heightspacing) {
imageline($image, 0, $i, 255, $i, $color2);
}
header("Content-type: image/png");
imagepng($image);
imagedestroy($image);
?>
However, when I replace the $widthspacing and $heightspacing variables with any number, it works okay! Even when I entered a numerical value submitted from the form for $heightspacing and $widthspacing, it didn't work. Why is this?
Also, if I DID enter it with a number, I see two unwanted lines at the bottom seperate from the grid. Why is this?
Thanks.