Email confirmation system for registration

Discussion in 'Programming' started by MCJim, Aug 27, 2008.

  1. #1
    I have a registration feature on my website which uses PHP and MySQL. After a user registers, I would like an email sent to his or her address with a confirmation link. How can I build such an automatic emailing system? Thanks.
     
    MCJim, Aug 27, 2008 IP
  2. rcadble

    rcadble Peon

    Messages:
    109
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    On signup, generate a random key and store in the database with that user. Use the PHP mail function to send an email to that user with a link like "http://www.site.com/verify.php?key={$key}&user={$username}". Proceed to make verify.php, where it checks to see that the $_GET['key'] matches with username in a MySQL query. If it's correct, modify that row of the user and set verified to true.
     
    rcadble, Aug 27, 2008 IP
  3. MCJim

    MCJim Peon

    Messages:
    163
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, I'll look into the code behind this.
     
    MCJim, Aug 27, 2008 IP