<!--vcode.class.php Content--
<?php
Class Vcode {
Private $width; Wide
Private $height; High
Private $num; Number
Private $code; Verification Code
Construction method, three parameters
function __construct ($width, $height, $num) {
$this->width = $width;
$this->height = $height;
$this->num = $num;
$this->code = $this->createcode (); Call your own method
}
Gets the verification code for the character to be saved in the server
function GetCode () {
return $this->code;
}
Output image
function outimg () {
Create background (color, size, border)
$this->createback ();
stooped (size, font color)
Interference elements (points, lines)
Output image
}
Create a background
Private Function Createback () {
}
Stooped
Private Function outstring () {
}
Setting interference elements
Private Function Setdisturbcolor () {
}
Output image
Private Function printimg () {
}
Generate Authenticode String
Private Function Createcode () {
$codes = "3456789abcdefghijkmnpqrstuvwxyABCDEFGHIJKLMNPQRSTUVWXY";
$code = "";
for ($i =0; $i < $this->num; $i +) {
return random characters
$code. = $codes {rand (0, strlen ($codes)-1)};
}
return $code;
}
}
Verification code class in PHP (one of the verification code function design)