The example in this article describes the verification code that PHP generates a clickable refresh. Share to everyone for your reference, specific as follows:
HTML file:
Authentication code file gd.php:
<?php
$im =imagecreate (50,20);
$b =imagecolorallocate ($im, 0,0,0);
$w =imagecolorallocate ($im, 255,255,255);
$mask = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$text = "";
For ($i =1 $i <=4; $i + +) {
$index =rand (0,61);
$text. = $mask {$index};
}
Imagestring ($im, 3,rand (10,20), Rand (0,10), $text, $w);
Header ("Content-type:image/jpeg");
Imagejpeg ($im);
? >
More about PHP Interested readers can view the site topics: "PHP graphics and pictures Operating skills summary", "PHP file Operation Summary", "PHP operation and operator Usage Summary", "PHP Network Programming Skills Summary", "PHP basic Grammar Introductory Course", " PHP Operations Office Document Tips summary (including word,excel,access,ppt), "PHP Date and Time usage summary", "PHP Introduction to Object-oriented Programming", "PHP string (String) Usage Summary", "php+ MySQL Database operations Introduction tutorial and PHP Common database operation Skills Summary
I hope this article will help you with the PHP program design.