Random gradient, random text color, random text length. I also made it rename itself, but I didn't include that in this version. I didn't write the creating the gradient part, since I wasn't sure how. Now I know. image.php - Code (Text): <?php header("Content-type: image/png"); $height = 45; $width = 70; $start_r = rand(0,255); $start_g = rand(0,255); $start_b = rand(0,255); $end_r = rand(0,255); $end_g = rand(0,255); $end_b = rand(0,255); $image = @imagecreate($width, $height); for($y=0;$y<$height;$y++) { for($x=0;$x<$width;$x++) { if ($start_r == $end_r) { $new_r = $start_r; } $difference = $start_r - $end_r; $new_r = $start_r - intval(($difference / $height) * $y); if ($start_g == $end_g) { $new_g = $start_g; } $difference = $start_g - $end_g; $new_g = $start_g - intval(($difference / $height) * $y); if ($start_b == $end_b) { $new_b = $start_b; } $difference = $start_b - $end_b; $new_b = $start_b - intval(($difference / $height) * $y); $row_color = imagecolorresolve($image, $new_r, $new_g, $new_b); imagesetpixel($image, $x, $y, $row_color); } } for ( $counter = 0; $counter <= rand(2,7) ; $counter += 1) { $choose = rand(1,2); if($choose == "1") { $value = $value . chr(rand(48,57)); } else { $value = $value . chr(rand(65,90)); } } setcookie("key", md5(md5($value))); $text_color = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255)); imagestring($image, 5, 5, 5, $value, $text_color); imagepng($image); imagedestroy($image); ?> index.php - Code (Text): <?php if($_GET['key']) { if(md5(ms5($_GET['key'])) == $_COOKIE["key"]) { echo "Correct code entered"; } else { header( 'Location: index.php?error=1') ; } } else { if($_GET['error']){ echo "Wrong code." . $_GET['error']; } ?> <form action="index.php" method="get"> Verification: <input type="text" name="key" /> <img src="image.php"> <input type="submit" value="Submit" /> </form> <?php } ?>