In this tutorial I will focus on registration from with email confirmation.
- First we have to create tabel in MySQL with user data and with field "auth_code". To this field script will insert unique number and send this number to email.
- Create vriable with unique id number $kod = uniqid();
- Modify SQL insert statement to insert this number to tabel with users mysql_query("INSERT INTO uzytkownicy (..., kod_aktywacyjny) VALUES (..., $kod)");
- Using mail function send mail with link and this number to email
- After click on link the next script has to get this number from url and compare it with number from database and show message that account was activated