<?php
// Start Image Verification Source Codes //
header("Content-type: image/png");
$image = @imagecreate (310, 180) or exit("Cannot Initialize new GD image stream");
global $directions1;
$session_vars = explode(":", $directions1);
$text = base64_decode($session_vars[0]);
$text2 = base64_decode($session_vars[1]);
$text3 = base64_decode($session_vars[2]);
$text4 = base64_decode($session_vars[3]);
$text5 = base64_decode($session_vars[4]);
if(!$session_vars){
$text = "- Sorry, but there was an error";
$text2 = " when trying to create the";
$text3 = " image. Please check to see if ";
$text4 = " Cookies are enabled in your";
$text5 = " browser. Thank You.";
}else{
if($text == "1"){$text = "- Check Box #1";}else{$text = "- Please Leave Box #1 Unchecked";}
if($text2 == "1"){$text2 = "- Check Box #2";}else{$text2 = "- Please Leave Box #2 Unchecked";}
if($text3 == "1"){$text3 = "- Check Box #3";}else{$text3 = "- Please Leave Box #3 Unchecked";}
if($text4 == "1"){$text4 = "- Check Box #4";}else{$text4 = "- Please Leave Box #4 Unchecked";}
if($text5 == "1"){$text5 = "- Check Box #5";}else{$text5 = "- Please Leave Box #5 Unchecked";}
}
$background_color = imagecolorallocate($image, 255, 255, 255);
$text_color = imagecolorallocate($image, 0, 0, 0);
$randomcolor1 = imagecolorallocate($image, rancolor(), rancolor(), rancolor());
$randomcolor2 = imagecolorallocate($image, rancolor(), rancolor(), rancolor());
$randomcolor3 = imagecolorallocate($image, rancolor(), rancolor(), rancolor());
function rancolor(){
return rand(150,225);
}
$points = array(
10,10,
300,170,
300,10,
10,170
);
imagefilledpolygon($image, $points, count($points)/2, $randomcolor1);
imageline($image, 10, 10, 10, 170, $text_color);
imageline($image, 300, 10, 300, 170, $text_color);
imagearc($image, 155, 90, 180, 180, 0, 360, $background_color);
imagefill($image, 155, 90, $randomcolor2);
imagefilledrectangle($image, 90, 20, 210, 160, $randomcolor3);
imageline($image, 90, 20, 90, 160, $background_color);
imageline($image, 210, 20, 210, 160, $background_color);
imagestring($image, 30, 15, 20, $text, $text_color);
imagestring($image, 30, 15, 50, $text2, $text_color);
imagestring($image, 30, 15, 80, $text3, $text_color);
imagestring($image, 30, 15, 110, $text4, $text_color);
imagestring($image, 30, 15, 140, $text5, $text_color);
imagepng($image);
// End Image Verification Source Codes //
?> |