Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Key application?

Asked Modified Viewed 3,005 times
S
snow-flake
S
smile
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
asked
Junior Member

Hello,

im looking for a application that will give keys out,

so i can put some keys in a text document
and it will generate a key and remove the used key from the text document,

something like, members may generate a key in a Panels
or they enter a email and get a key send to it,

it's a bit hard to explain :)

im still learning to code and stuff not so good at it lol
hope u guys can help me out

greetings Snowy
0 replies

14 posts

H
HobbyMan
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
answered
Veteran Member

Does the key have to be sequential or would a random character generator do?

Btw, pls fix your sig image to comply with CoC.
0 replies
S
snow-flake
S
smile
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

Hello, ty for your reply

A program generate a key for me
---------------exemple keys-------------
RosUznL8u4vo7FPhfKzmyVOSsTCvXTH0CIQSdpEd
jOiXmV29THVaqOEfywPl1xmXEhRBgL1JLdhC7p4A
UtC4dg7NF3zNBYryQHeB6IOOZfiUvQB7chOgfZ8w
-----
So i need to put the keys in a text file (exemple, key.txt)
when a user/member use it it will auto remove the key form the file key.txt

i need to enter the key in the file so it may not be a randome one



My apologies for the signature :D

Greetings Snowy
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Here is a quick RandomKeyGen Function for you....

<?php
function RandomKeyGen($length=10)
{
   $key = '';
   list($usec, $sec) = explode(' ', microtime());
   mt_srand((float) $sec + ((float) $usec * 100000));
   
      $inputs = array_merge(range('z','a'),range(0,9),range('A','Z'));

      for($i=0; $i<$length; $i++)
   {
          $key .= $inputs{mt_rand(0,61)};
   }
   return $key;
}


 echo RandomKeyGen(40); 

?>
0 replies
S
snow-flake
S
smile
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

Dont need a Random key generator m8
i need to make the keys :) that is the problem :(
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

Sure ok look up fwrite()

http://php.net/manual/en/function.fwrite.php
0 replies
S
snow-flake
S
smile
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

wow uhm.. this is going way out of my knowledge i don't really understand how it works

is it possible that you make a exemple code ? that would be great,

Tank you
Greetings Snowy
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

What will the random keys be for?

Also for the second time please make your signature smaller it is a violation of the Code of Conduct, it's to big.

Thanks
0 replies
S
snow-flake
S
smile
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

giving user access to a program and the program only accepts his own generated keys
so it cannot be a random key ,
im looking for a script that cen give key and remove used keys

something like with a button (generate a key)
the script will get a key out of the text file and remove it after giving it to the user
so the key never will get out 2 times

it's a bit hard to explain :@


My apologies for the signature for the second time photobucket is restoring it every time to the original size :@
Greetings
0 replies
N
NetriX
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
answered
Senior Member

Here's an example.

Saving data to text file.
<?php
$fp = fopen('data.txt', 'w');
fwrite($fp, '23');
fclose($fp);
?>


Reading contents of the text file.
<?php
$read = file_get_contents('http://www.example.com/data.txt');
echo $read;
?>


Good Luck,
NetriX
0 replies
S
snow-flake
S
smile
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

hello
sry for late reply

this code
<?php
$read = file_get_contents('http://www.example.com/data.txt');
echo $read;
?>


is what im looking for but it is reading the compleet file need to be line by line


-----------------------------------------
this is in the file keys.txt

Quote


RosUznL8u4vo7FPhfKzmyVOSsTCvXTH0CIQSdpEd

jOiXmV29THVaqOEfywPl1xmXEhRBgL1JLdhC7p4A

UtC4dg7NF3zNBYryQHeB6IOOZfiUvQB7chOgfZ8w


so the code need to read one line/key
example
<?php
$myFile = "keys.txt";
$fh = fopen($myFile, 'r');
$theData = fgets($fh);
fclose($fh);
echo $theData;
?>


it need to show the first line in the file (keys.txt),

Quote

RosUznL8u4vo7FPhfKzmyVOSsTCvXTH0CIQSdpEd


after the key is shown up it need to remove the key from the file (keys.txt),

Quote


jOiXmV29THVaqOEfywPl1xmXEhRBgL1JLdhC7p4A

UtC4dg7NF3zNBYryQHeB6IOOZfiUvQB7chOgfZ8w


and show up the next one in line

so every time a line is used it need to remove it
i hope its is poseble
Edited by snow-flake on 03-06-2011 23:59,
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

You can use db for it? Much faster and comfortable.
0 replies
S
snow-flake
S
smile
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

how can i use the database for that ?
i don't understand what u mean
0 replies
P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

Insert your keys into the db (INSERT ... ) and after that, give one to the user (SELECT ...) .
After that you can delete this key (DELETE WHERE key=... ) or mark as used (UPDATE SET ... ) .
0 replies
S
snow-flake
S
smile
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions
answered
Junior Member

sry polarfox i still dont u get it :( can you maybe make a example for me that would be great
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 14 posts
  • Votes 0 votes
  • Topic users 5 members

5 participants

C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
H
H
Just some Guy
  • Veteran Member, joined since
  • Contributed 1,486 posts on the community forums.
  • Started 91 threads in the forums
N
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
P
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
S
S
smile
  • Junior Member, joined since
  • Contributed 12 posts on the community forums.
  • Started 2 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet