...

View Full Version : Tokens?



Jake:)
03-17-2010, 10:30 PM
Hello CodingForums!

At the moment, I am setting up a script that allows people to register a cpanel email automatically. Got that working lovely! Its just, I now want to add a extra on that will stop others from registering an email(people without my consent)

So basically, I want to make it so I set a big list of tokens in a file, or strings and then I would give one out. The user would then use it and get their email address, and the token being deleted from the file it was called from.

Anyone got any ideas?

Jake:)
04-04-2010, 06:20 PM
bump.

MattF
04-04-2010, 06:30 PM
$string = file_get_contents($tokenfile);

if (strpos($string, $token) !== false)
{
$string = str_replace($token, '', $string);
file_put_contents($tokenfile, $string);
[valid token code]
}
else
{
[invalid token code]
}


That's assuming you have PHP5+. PHP4, you would need to use fopen etc.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum