Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCUMENT HTML>
- <html>
- <head>
- <title>Keygen</title>
- <meta charset='utf-8'/>
- <link href='style.css' type='text/css' rel='stylesheet'>
- </head>
- <body>
- <?php
- if ($_POST["submit"] != '') {
- $keys_str = file_get_contents('keys.txt');
- $keys = explode("\r\n", $keys_str);
- $used = 0;
- $max_used = 30;
- $numbers = 25;
- for ($i = 0; $i < count($keys); $i++) {
- if (explode(':', $keys[$i])[1] == 'used') {
- $used = $used + 1;
- }
- }
- if ($used < $max_used) {
- $zeichen = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0');
- $again = true;
- while ($again == true) {
- $key = '';
- $key_str = '';
- $again = false;
- for ($i = 0; $i < $numbers; $i++) {
- mt_srand(67485459533427 * microtime());
- $index = (mt_rand(0, 10000) + microtime()) % 35;
- $char = $zeichen[$index];
- $key = $key.$char;
- $key_str = $key_str.$char;
- if ((($i + 1) % 5 == 0) && (($i + 1) != $numbers)) {
- $key_str = $key_str.'-';
- }
- }
- for ($i = 0; $i < count($keys); $i++) {
- if (explode(':', $keys[$i])[0] == $key) {
- $again = true;
- }
- }
- }
- echo 'Key: '.$key_str;
- file_put_contents('keys.txt', $key."\r\n", FILE_APPEND);
- } else {
- echo "Der Beta-Zugang wurde geschlossen";
- }
- }
- ?>
- <form action='key.html' method='post'>
- <input type='submit' name='submit' value='Beta-Zugang erhalten' />
- </form>
- </body>
Add Comment
Please, Sign In to add comment