Hello, I'm new to this forum, so PLEASE let me know if I'm doing something bad, thanks.
So, I need to make referral system (kind of), if anyone could help me, that would be great!
I know how to display the code from database, so that's not a problem (I don't need to hash it either).
So, I want that a signed in user could see his referral code, and so when user gives his code to someone they put it in registration page, and register, but if they don't write a valid code, registration would fail.
And the referring user could see how many users have registered using his code.
I have an idea how it would work:
Currently existing users would get their code, which would be generated by "PHP Random Code Generator" of some sort, then it would put it into a MySQL table (PDO), php code would display it on page.
When user puts in a code on registration page, when he submits the form, it checks if code is valid, and who it belongs to, and does +1 (Adds 1) to the number of registration completed with his code.
And so on.
Hope you could help me, thanks.