user table:
CREATE TABLE IF NOT EXISTS `users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(255) COLLATE utf8_persian_ci NOT NULL, `password` varchar(255) COLLATE utf8_persian_ci NOT NULL, `email` varchar(100) COLLATE utf8_persian_ci NOT NULL, `created` datetime NOT NULL, `status` tinyint(1) NOT NULL, `activation_code` varchar(255) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `email` (`email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_persian_ci AUTO_INCREMENT=4 ;
when the user is registered, u can set a unique line (sample: md5 (time ()) or any thing ...) in the activ_code field. now send an email like this url to user:
http://test/controller/action/activation_code
Now you need to check the action that this activation identifier is in the user table or not.
and if this is what status = disable or not ....
Chalist
source share