Jump to content

[SOLVED] how to send a validation link email to the user.


Recommended Posts

how to send a validation link email to the user.

which contains in most website now.

when user successful register then the system will send a validation email to the user.

when the user click the validation link in the email then will activate the user's account

anyone know wat this method called, and how to write it?

thanks..

Add to fields to the database,

Active, ActivationCode (or whatever)

Now

When you create an account, set Active to 0, and a random code in ActivationCode,

ie MD5(time());

 

on logon check that Active is 1,

 

Now email them a link ie

http:\\blar.com\activate.php?email=[email entered]&Activate=[CodeRenerated]

 

Now in your activate.php,

Use something like

<?php
$email = $_GET['email'];
$Activate= $_GET['Activate'];
//Add Filter to above to stop injection

//SQL stuff
//UPDATE users SET Active=1 WHERE email='$email' AND Activate='$Activate';
?>

 

also remeber a link to re-sent the activation code (search for email)

 

hope this helps

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.