code = ''; $this->key = $key; } // End PJ_SecurityImage function encrypt($plain_text) { $this->code = trim(sha1($plain_text.$this->key)); } // End encrypt function checkCode($mystring,$checksum) { $this->encrypt($mystring); if ($this->code == $checksum) return true; else return false; } // End checkCode function printImage($random_number) { $im = @imagecreate(150, 40) or die("Cannot Initialize new GD image stream"); $background_color = imagecolorallocate($im, mt_rand(0,100), mt_rand(0,100), mt_rand(0,100)); for ($i=0;$icode; } // End get } // End class PJ_SecurityImage