Search code examples
phpdatabasecodeignitersecurityuser-management

How to add user to database after email confirmation?


I have a website built with PHP Codeigniter framework. It has an user management system. Generally, what it does is, when an user registers, it add his information to database and sends a conformation email(like other systems).

But now some spammers are creating lots of accounts. They don't verify the email though. Just add more records to the database. However, my database is getting heavy for this. How can I prevent this?

Is there any workflow by which I can add an user after his email confirmation?

Thanks in advance.


Solution

  • it is not possible to insert the user after sucessfully confirmation mail you can follow some steps to restrict the users

    1. create a captcha in your registration form
    2. make a new table ie blueprint of your registration table so the user register go to this new table then if the user is confirm there mail then the record move to orginal registation table and delete from the new one
    3. to blok the user by one user one ip is not a good solution so don't restrict them
    4. just run a cron job on every 3 day on the new blueprint of the table so the users that is not confirm their mail simply remove all the entries from the new table on every three days on every week. thats it Thanks.