Advertisement
DanielYTK

Untitled

Nov 13th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. /*if(!isset($_POST["id"])){
  3. return;
  4. }*/
  5.  
  6. class generateKey{
  7.  
  8. private $plugin;
  9.  
  10. public function __construct($tamanho = 15){
  11. $this->tamanho = $tamanho;
  12. }
  13.  
  14. public function gerar(){
  15. $key = "";
  16. $all = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890";
  17. for($i=0 ; $i < $this->tamanho; $i++){
  18. $key .= $all[mt_rand(0, 61)];
  19. }
  20. return $key;
  21. }
  22. }
  23.  
  24. $html = false;
  25.  
  26. $a = fopen("ids.yml", "a");
  27. fclose($a);
  28.  
  29. $keyfix = "";
  30. $file = yaml_parse("ids.yml");
  31.  
  32. if(array_key_exists("DanielYTK", $file)){
  33. unset($file["DanielYTK"]);
  34. file_put_contents($file);
  35. $key = new Key(20);
  36. $keyfix = $key->gerar();
  37. $this->html = true;
  38. }
  39.  
  40.  
  41.  
  42. if($html === false){
  43. return;
  44. }
  45. ?>
  46.  
  47. <!DOCTYPE html>
  48. <html>
  49.  
  50. <head>
  51.  
  52. <title>KEY</title>
  53.  
  54. </head>
  55.  
  56. <body>
  57.  
  58. <center><h1><?php $keyfix ?></h1><center>
  59.  
  60. </body>
  61.  
  62.  
  63.  
  64. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement