Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Tokens?

  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Tokens?

    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?

  • #2
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts
    bump.

  • #3
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Code:
    $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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •