ShuDudu's Home was started in 2011, but the web data is lost, so now begin again, I would like to make some friends, I hope you like ShuDudu's home.
Current position: ShuDudu > Life >

[PHP] Random additional code generation for PHP

Thursday on June 9th, 2005Life

Random additional code generation of PHP:

Filename: authpage.php

 & lt;?/** Filename: authpage.php* Author: hutuworm* Date: 2003-04-28* @ Copyleft hutuworm.org,/Srand ((double) microtime () * 1000000);//verify whether the user input is consistent with the CAPTCHAIf (isset ($HTTP_POST_VARS ['authinput'])){If (strcmp ($HTTP_POST_VARS ['authnum'], $HTTP_POST_VARS [' authinput']) = 0)Echo & quot; verification successful! & quotElseEcho & quot; validation failed! & quot}//generate a new four-digit integer CAPTCHAWhile (($authnum=rand ()% 10000) & lt;1000)? & gt& lt;form action=authpage.php method=post>& lt;table>Please enter the verification code: & lt;input type=text name=authinput style="width: 80pxposiquot& lt;input type=submit name=" Verification & quot; value=" submit CAPTCHA & quot;>& lt;input type=hidden name=authnum value= 

Filename: authimg.php

 & lt;?/** Filename: authimg.php* Author: hutuworm* Date: 2003-04-28* @ Copyleft hutuworm.org,///generate CAPTCHA imageHeader (& quot;Content-type: image/PNG")Srand ((double) microtime () * 1000000)$im = imagecreate (58, 828)$black = ImageColorAllocate ($im, 0je 0jol 0)$white = ImageColorAllocate ($im, 255255255)$gray = ImageColorAllocate ($im, 200200200)Imagefill ($im,68,30,$gray)//draw a four-digit integer CAPTCHA into the pictureImagestring ($im, 5,10,8, $HTTP_GET_VARS ['authnum'], $black)For ($iposit/interference pixel//add interference pixel{Imagesetpixel ($im, rand () 70, rand () 30, $black)}ImagePNG ($im)ImageDestroy ($im)? & gt; 

Copyright Protection: ShuDudu from the original article, reproduced Please keep the link: https://www.shududu.com/life/PHP-Random-additional-code-generation-for-PHP.htm