Advertisement
DanielYTK

Untitled

Nov 13th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 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. header("Locate: noexists.html"); # ENVIAR O CLIENTE PRA UMA PÁGINA DIZENDO QUE O ID DE COMPRA NÃO EXISTE
  44. return;
  45. }
  46. ?>
  47.  
  48. <!DOCTYPE html>
  49. <html>
  50.  
  51. <head>
  52.  
  53. <title>KEY</title>
  54.  
  55. </head>
  56.  
  57. <body>
  58.  
  59. <center><h1><?php $keyfix ?></h1><center>
  60.  
  61. </body>
  62.  
  63.  
  64.  
  65. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement