Guest User

Untitled

a guest
Jul 16th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2. function make_seed()
  3. {
  4. list($usec, $sec) = explode(' ', microtime());
  5. return (float) $sec + ((float) $usec * 100000);
  6. }
  7.  
  8. srand(make_seed());
  9.  
  10. $chars = array(1,2,3,4,5,6,7,8,9,
  11. "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",
  12. "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");
  13.  
  14. $colors = array("red","blue","green","darkblue","purple","darkgreen","orange","lightgreen");
  15.  
  16. $CAPTCHA = "";
  17. for($i=0; $i<6; $i++){
  18. $color = $colors[rand(0,7)];
  19. $CAPTCHA.= "<font color='". $color ."'>". $chars[rand(0,60)] ."</font>";
  20. }
  21. echo $CAPTCHA;
  22. ?>
Add Comment
Please, Sign In to add comment