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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    905
    Thanks
    23
    Thanked 5 Times in 5 Posts

    Adding a user to mysql using php : confirmation link?

    hey there
    ok so i wrote a php script that connects to mysql.. and creates a new user from a form thats submitted to php_self...and it sends an email to the new user with user details.. is there anyway with that mail icould send a confirmation link.. and the account is n ot active untill this is clicked?
    any ideas?
    cheers
    P

  • #2
    Regular Coder
    Join Date
    Sep 2002
    Location
    Bulgaria
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,
    Add a field to Your users table, for example [acc_active] and make it default to false.
    Then in the mail body:
    <a href="http://someserver/activate.php?account_id=xxx">Activate Your account</a>
    In the activate.php get the account_id from the QueryString and reset the [acc_active] field to true for the user corresponding to account_id.
    Then redirect the user somewhere else, or just display a message saying that the account has been activated.

    Alex


  •  

    Posting Permissions

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