Jump to content

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


zgkhoo

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.