Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function make_seed()
- {
- list($usec, $sec) = explode(' ', microtime());
- return (float) $sec + ((float) $usec * 100000);
- }
- srand(make_seed());
- $chars = array(1,2,3,4,5,6,7,8,9,
- "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z",
- "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
- $colors = array("red","blue","green","darkblue","purple","darkgreen","orange","lightgreen");
- $CAPTCHA = "";
- for($i=0; $i<6; $i++){
- $color = $colors[rand(0,7)];
- $CAPTCHA.= "<font color='". $color ."'>". $chars[rand(0,60)] ."</font>";
- }
- echo $CAPTCHA;
- ?>
Add Comment
Please, Sign In to add comment