Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


Invite only registration filter_list
Author
Message
Invite only registration #1
Hello, I've been wondering how I would go about making my website invite only. What I mean by that is when you go to the webpage you'll be greeted with a Login page and if you don't have an account you Register (obviously), but when you register on the site it asks you for an invitation code and if you don't have one you can't register. Also if at all possible I would also want to give users 3 codes they can give to other people and so on and so fourth. I have looked everywhere online for days trying to find how to do this but have come up with nothing (probably also because I'm a noob web developer), have help would be appreciated.

Reply

RE: Invite only registration #2
Just link it to a database? Wouldn't be to hard, add 3 columns in your user table, inv_code1, inv_code2... and when a user tries to sign-up check if the key is found in the database? For generating the keys you could either use your own algorithm or use an existing one, a personal one would be best in terms of security (if you know a little crypto) but I'm sure people here can help you explain that.
~~ Might be back? ~~

Reply

RE: Invite only registration #3
(02-23-2017, 11:51 AM)Bish0pQ Wrote: Just link it to a database? Wouldn't be to hard, add 3 columns in your user table, inv_code1, inv_code2... and when a user tries to sign-up check if the key is found in the database?

This ^^^

And when adding the columns to the table, configure It properly using the correct data type and character length/range.
[Image: AD83g1A.png]

[+] 2 users Like mothered's post
Reply

RE: Invite only registration #4
(02-23-2017, 11:51 AM)Bish0pQ Wrote: Just link it to a database? Wouldn't be to hard, add 3 columns in your user table, inv_code1, inv_code2... and when a user tries to sign-up check if the key is found in the database? For generating the keys you could either use your own algorithm or use an existing one, a personal one would be best in terms of security (if you know a little crypto) but I'm sure people here can help you explain that.

I see that makes sense. Sorry just one more question, how would I make it to where the invitation code is randomly generated and can only be used once?

Reply

RE: Invite only registration #5
(02-23-2017, 08:38 PM)ZherkTG Wrote:
(02-23-2017, 11:51 AM)Bish0pQ Wrote: Just link it to a database? Wouldn't be to hard, add 3 columns in your user table, inv_code1, inv_code2... and when a user tries to sign-up check if the key is found in the database? For generating the keys you could either use your own algorithm or use an existing one, a personal one would be best in terms of security (if you know a little crypto) but I'm sure people here can help you explain that.

I see that makes sense. Sorry just one more question, how would I make it to where the invitation code is randomly generated and can only be used once?

Just create a simple algorithm in Python and run a duplicate check on the list. You can also auto-assign keys I think but I don't work that much with databases.
~~ Might be back? ~~

Reply

RE: Invite only registration #6
If you have a website and know PHP, SQL, ... it's pretty simple to figure out on your own.

Reply

RE: Invite only registration #7
(02-23-2017, 11:03 PM)m0dem Wrote: If you have a website and know PHP, SQL, ... it's pretty simple to figure out on your own.

Which do you think would work better; Django or or PHP?

Reply

RE: Invite only registration #8
(02-25-2017, 12:47 AM)ZherkTG Wrote:
(02-23-2017, 11:03 PM)m0dem Wrote: If you have a website and know PHP, SQL, ... it's pretty simple to figure out on your own.

Which do you think would work better; Django or or PHP?

No clue. I don't know exactly what Django is/does.
Whatever you can do.

Reply

RE: Invite only registration #9
(02-25-2017, 12:47 AM)ZherkTG Wrote:
(02-23-2017, 11:03 PM)m0dem Wrote: If you have a website and know PHP, SQL, ... it's pretty simple to figure out on your own.

Which do you think would work better; Django or PHP?

I personally know that PHP has been around longer and has a larger community, which means that more tutorials and documentation exists for it and it wouldn't be super hard to find help for it.

For what you are trying to do you can just google Random String Generator PHP on google and you will find this as one of the first links, it is a stack overflow answer and it gives you a PHP function to randomly generator a string I recommend setting it to a length of 7 then you can create a database with a table called codes ( or whatever you want really ) and have and ID (with auto increment on) then a spot for the code to be set (Put it as a varchar with a length of 7) then create that, head over to w3schools PHP Tutorials you can use this and find out how to connect to your database, select rows in a table to see if it exists, and how to insert information into it.

Have fun, if you got any questions just ask.

Reply







Users browsing this thread: 4 Guest(s)